Skip to content

python workspaceFolder bug #691

Closed

Description

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 (5190885, 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

Activity

  1. DonJayamanne commented on Feb 2, 2018

    @DonJayamanne

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

  2. chrzamz commented on Feb 2, 2018

    @chrzamz
  3. DonJayamanne commented on Feb 4, 2018

    @DonJayamanne

    @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.

  4. adiun commented on Feb 8, 2018

    @adiun

    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.

  5. scp-r commented on Feb 8, 2018

    @scp-r

    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.

  6. ksesong commented on Feb 8, 2018

    @ksesong

    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).

  7. rhummer commented on Feb 8, 2018

    @rhummer

    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.

  8. 5 remaining items

  9. DonJayamanne commented on Feb 9, 2018

    @DonJayamanne

    @YMIndustries Ryan Hummer (@rhummer) Korn Seang Edouard Song (@ksesong) @Jasper0819X Adi Unnithan (@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.

  10. added a commit that references this issue on Feb 13, 2018
    6389ad3
  11. DonJayamanne commented on Feb 14, 2018

    @DonJayamanne

    @zzylog7 Korn Seang Edouard Song (@ksesong), Adi Unnithan (@adiun), Joshua Sleeper (@joshsleeper) MetaFight Joshua Sleeper (@joshsleeper) Adi Unnithan (@adiun) @Jasper0819X Ryan Hummer (@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

  12. MetaFight commented on Feb 14, 2018

    @MetaFight

    Don Jayamanne (@DonJayamanne) excellent! Thank you very much :)

  13. arthurspa commented on Feb 21, 2018

    @arthurspa
  14. saamkhya commented on Apr 5, 2018

    @saamkhya

    ${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.

  15. DonJayamanne commented on Apr 5, 2018

    @DonJayamanne

    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.

  16. locked as resolved and limited conversation to collaborators on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions