-
Notifications
You must be signed in to change notification settings - Fork 131
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
Crash: ModuleNotFoundError: No module named 'pydevd_file_utils' #542
Comments
This is an interesting edge case! What's happening here is that venv is creating a subprocess, and the debugger is trying to intercept process creation and inject itself in there. But it looks like there's a conflict between venv and pydevd both trying to adjust PYTHONPATH here, and venv "wins" and effectively erases pydevd from the path? The immediate workaround is to disable subprocess debugging: "subProcess": false I'm not sure if there's anything we can do here otherwise, though. @fabioz? |
Thanks for reply. @int19h |
I think that in |
Environment data
python.languageServer
setting: Pylance v2021.2.0[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
I can debug my project
Actual behaviour
Got a crash: ModuleNotFoundError: No module named 'pydevd_file_utils'
Steps to reproduce:
Create python env and then set vscode to use it
python3.9 -m venv venv
Coding
Terminal log
``` cd /Users/zhaoye/work/stash/playground ; /usr/bin/env /usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Users/zhaoye/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/debugpy/launcher 55494 -- /Users/zhaoye/work/stash/playground/pydevbug/run.py Traceback (most recent call last): File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/zhaoye/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/debugpy/__main__.py", line 45, in cli.main() File "/Users/zhaoye/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main run() File "/Users/zhaoye/.vscode/extensions/ms-python.python-2021.1.502429796/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file runpy.run_path(target_as_str, run_name=compat.force_str("__main__")) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 268, in run_path return _run_module_code(code, init_globals, run_name, File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/zhaoye/work/stash/playground/pydevbug/run.py", line 4, in venv.main(args=[ File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv/__init__.py", line 493, in main builder.create(d) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv/__init__.py", line 75, in create self._setup_pip(context) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv/__init__.py", line 300, in _setup_pip subprocess.check_output(cmd, stderr=subprocess.STDOUT) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/Users/zhaoye/work/tmp/lb/bin/python3.9', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. ```Venv code
Got this error message : ModuleNotFoundError: No module named 'pydevd_file_utils'
Terminal log
The text was updated successfully, but these errors were encountered: