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

Error: spawn $ {workspaceFolder}\.env\Scripts\python.exe ENOENT #853

Closed
FlavioCestari opened this issue Feb 21, 2018 · 10 comments
Closed

Error: spawn $ {workspaceFolder}\.env\Scripts\python.exe ENOENT #853

FlavioCestari opened this issue Feb 21, 2018 · 10 comments
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Milestone

Comments

@FlavioCestari
Copy link

FlavioCestari commented Feb 21, 2018

Environment data

VS Code version: 1.20.1
Python Extension version: 2018.1
Python Version: 3.6.3
OS and version: Windows 7 Enterprise

Actual behavior

After starting debugging (using default Python configuration template), I get this error:

  • Debug console: Error: spawn $ {workspaceFolder}\.env\Scripts\ python.exe ENOENT
  • Alert message: Failed to launch the Python Process, please validate the path $ {workspaceFolder}\.env\Scripts\python.exe

After starting debugging, but using "Python: Terminal (integrated)" configuration template, I get the error below and the debug feature stops working (it's not possible to debug again unless restart VSCode):

C:\{project-path}>cd c:\{project-path} && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && ${workspaceFolder}.virtualenv\Scripts\python.exe C:\Users\{username}\.vscode\extensions\ms-python.python-2018.1.0\pythonFiles\PythonTools\visualstudio_py_launcher.py c:\{project-path} 60668 34806ad9-833a-4524-8cd6-18ca4aa74f14 DUMMYVALUE c:\{project-path}\startfile.py
"The system cannot find the path specified."

This issue occurs after VSCode's upgrade to 1.20.x version.

ps .: ".env" is my virtualenv directory.

Expected behavior

debugging normally

Steps to reproduce:

  • Open VSCode
  • Open folder ou workspace
  • Click in Start Debugging button or Debug>Start Debugging menu or type [F5].
@FlavioCestari FlavioCestari changed the title Error: spawn $ {workspaceFolder}\.env\Scripts\ python.exe ENOENT Error: spawn $ {workspaceFolder}\.env\Scripts\python.exe ENOENT Feb 21, 2018
@FlavioCestari
Copy link
Author

I tried renaming the virtualenv directory (.env) to .virtualenv but got the same error.

Steps to rename virtualenv:

  1. > rm -r .env
  2. > virtualenv .virtualenv
  3. > .virtualenv\Scripts\activate
  4. (.virtualenv) > pip install -r requirements.txt
  5. > deactivate

@FlavioCestari
Copy link
Author

launch.json file:

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "env": {},
            "envFile": "${workspaceFolder}/.env",
            "debugOptions": [
                "RedirectOutput"
            ]
        },
        {
            "name": "Python: Terminal (integrated)",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "console": "integratedTerminal",
            "env": {},
            "envFile": "${workspaceFolder}/.env",
            "debugOptions": []
        }
    ]
}

settings.json file:

{
    "python.pythonPath": "${workspaceFolder}\\.virtualenv\\Scripts\\python.exe"
}

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs verification area-debugging labels Feb 21, 2018
@DonJayamanne
Copy link

Duplicate of #691

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

@hash
Copy link

hash commented Mar 1, 2018

@DonJayamanne the odd thing is happening on linux Fedora 27 xfce, fresh virtual machine.
I have "pythonPath": "${config:python.pythonPath}", in launch.json
I get Error: spawn ${workspaceFolder}/.venv/bin/python ENOENT when trying to debug,
I change it to "pythonPath": "${workspaceFolder}/.venv/bin/python", same path is in settings.json
it works, then I change it back to "pythonPath": "${config:python.pythonPath}",
it STILL! works. I restart VSCode and it stops working.

I am using insiders build that is reporting version 2018.2.0-beta and VSCode 1.20.1 .

@DonJayamanne
Copy link

@hash
It works at this end. Its possible something isn't setup correctly at your end.

  • Please uninstall all python extensions
  • Download and re-install the latest version of the insiders build (once again)
  • Wait for the prompt to re-start VS Code
  • Test debugging

@hash
Copy link

hash commented Mar 1, 2018

Ok, I am now able to reproduce the error when I try to debug just after VSCode starts, but not after some seconds pass.
So not an issue.

@awhillas
Copy link

awhillas commented Apr 6, 2018

I'm still getting this error even after disabling all extensions (except this one of course). Yes "I've tried turning it off and on again" (somethings never change with M$ products :D)

Error: spawn /Users/alex/dev/venv/ingest-sU4WTsve/bin/python ENOENT

using pipenv and vscode Version 1.22.1 (1.22.1)

@DonJayamanne
Copy link

@awhillas
have you tried uninstalling and re-installing (two comments up, #853 (comment))

@brettcannon brettcannon added the info-needed Issue requires more information from poster label Apr 9, 2018
@awhillas
Copy link

awhillas commented May 3, 2018

@DonJayamanne yes, no dice :(

@DonJayamanne
Copy link

Please create another issue if you are still experiencing this issue, This has been closed.

@microsoft microsoft locked as resolved and limited conversation to collaborators May 3, 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 info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants