Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python workspaceFolder bug #691

Closed
alexdima opened this issue Feb 2, 2018 · 14 comments · Fixed by #774
Closed

python workspaceFolder bug #691

alexdima opened this issue Feb 2, 2018 · 14 comments · Fixed by #774
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@alexdima
Copy link
Member

alexdima commented Feb 2, 2018

Moved from microsoft/vscode#42787
From @zzylog7


Issue Type

Bug

Description

python debug Error: spawn ${workspaceFolder}\env\Scripts\python.exe ENOENT, "env" is python venv directory , I modify .vscode/setting.json >> python.pythonPath to a full dir and it worked!

VS Code Info

VS Code version: Code - Insiders 1.20.0-insider (519088548b09221e9d590d2e10e14ec6d27ac79a, 2018-02-01T14:21:12.284Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz (4 x 2295)
Memory (System) 11.91GB (6.19GB free)
Process Argv C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
yaml ada 0.0.10
vscode-eslint dba 1.4.5
tslint eg2 1.0.24
vscode-great-icons emm 2.1.24
php-debug fel 1.12.1
php-intellisense fel 2.2.5
php-pack fel 1.0.1
svn-scm joh 1.13.2
php-cs-fixer jun 0.1.56
python ms- 2018.1.0
php-docblocker nei 1.3.3
autodocstring njp 0.1.4
vetur oct 0.11.7
ayu tea 0.12.0

(1 theme extensions excluded)

Reproduces only with extensions
@DonJayamanne
Copy link

@zzylog7 please could you go into your work space settings and let me know the exact value of the "python.pythonPath" setting?

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster feature-extension labels Feb 2, 2018
@bcxy007
Copy link

bcxy007 commented Feb 2, 2018 via email

@DonJayamanne DonJayamanne added awaiting 1-verification and removed info-needed Issue requires more information from poster labels Feb 2, 2018
@DonJayamanne
Copy link

@zzylog7 please could you test this on the latest stable version of vscode and the latest version of the extension (not insiders build if vscode).
Please confirm that the folder you have opened in vscode is newAnt.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed awaiting 1-verification labels Feb 4, 2018
@DonJayamanne DonJayamanne added this to the February 2018 milestone Feb 5, 2018
@adiun
Copy link

adiun commented Feb 8, 2018

I'm hitting this too, right after I upgraded to the latest VSCode 1.20.0. Previously I had vscode-python 2018.1.0. This issue did not happen with vscode-python 2018.1.0 and the previous version of VSCode.

My previous pythonPath was: "${workspaceRoot}/.virtualenv/bin/python". I am using .virtualenv as a symlink to a virtualenv in my user dir, managed by virtualenvwrapper. But even if I don't use a symlink, and have the entire virtualenv in my workspace folder with the python path pointing to it, it doesn't work.

Note: I'm not sure if this is related, but in at least VSCode 1.20.0, it looks like workspaceRoot support has been deprecated in favor of workspaceFolder. I didn't even realize that the workspaceRoot env var was deprecated. Support hasn't been dropped though, I can still use workspaceRoot in launch.json.

But even if I make pythonPath = "${workspaceFolder}/.virtualenv/bin/python" that doesn't work.

@scp-r
Copy link

scp-r commented Feb 8, 2018

I got this bug after I upgraded to vscode 1.20.0, and my pythonPath is "${workspaceFolder}\venv\Scripts\python.exe".

If I change pythonPath to ".\venv\Scripts\python.exe" then everything works fine.

@ksesong
Copy link

ksesong commented Feb 8, 2018

I'm having the same issue as well. vscode 1.20.0; vscode-python 2018.1

This might be related to the multi-root workspace; when I directly open the project, the setting "python.pythonPath": "${workspaceFolder}/.venv/bin/python" works as expected, but when I switch to the multi-root workspace, it does not manage to find the environment (and I can't find it in the prompt Select Interpreter).

@rhummer
Copy link

rhummer commented Feb 8, 2018

Seeing this as well with vscode 1.20.0, vscode-python 2018.1.0. I was not seeing an issue until I updated to vscode 1.20.0 from 1.19.3.

I have my python.pythonPath set to "${workspaceRoot}/.env/Scripts/python.exe" it did not work, changing to "${workspaceFolder}/.env/Scripts/python.exe" also did not work.

As mentioned above changing to a fully qualified path or relative path, ./.env/Scripts/Python.exe, worked. Using the environment selection IO to choose the correct virtualenv also doesn't work since it auto fills it as "${workspaceFolder}/.env/Scripts/python.exe"

No symlinks involved on my end.

@DonJayamanne DonJayamanne added awaiting 1-verification and removed info-needed Issue requires more information from poster labels Feb 8, 2018
@YoshiWalsh
Copy link

@Jasper0819X Thanks for the workaround. I'm new to Python and this issue was making it hard for me to get started.

@DonJayamanne
Copy link

@YMIndustries @rhummer @ksesong @Jasper0819X @adiun @zzylog7
I do apologize for this issue, unfortunately its an upstream issue in VS Code.
Hopefully we can get this sorted out asap.

@alexandrudima I've created a new issue microsoft/vscode#43303 for this in the VS Code repo.

@DonJayamanne
Copy link

@zzylog7 @ksesong, @adiun, @joshsleeper @MetaFight @joshsleeper @adiun @Jasper0819X @rhummer

The fix will be in the next release (end of this month).

Until then please use the Insiders build of this extension as it contains the fix (Note: I'm not referring to VS Code Insiders).

The instructions to download and install this insiders build of the extension can be found here, under Insiders Buid

@MetaFight
Copy link

@DonJayamanne excellent! Thank you very much :)

@arthurspa
Copy link

@DonJayamanne thanks, it worked!

@saamkhya
Copy link

saamkhya commented Apr 5, 2018

${config:python.pythonPath} seems to be NOT working inside the tasks.json file for building the task.
python.pythonPath is set to ${workspaceFolder}/venv/bin/python under Users settings.
When the command is set to ${workspaceFolder}/venv/bin/python instead of ${config:python.pythonPath}, it is working fine.

Though ${config:python.pythonPath} seems to be working fine with the launch.json for the debugger.

@DonJayamanne
Copy link

@saamkhya
Not sure whether config:python.pythonPath is supported in tasks.json. You'll need to create an issue in VS Code to find that out, not here.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.