I'm doing Python/Django development in WSL2:Ubuntu 20.04. When opening VSCode with code .
, the Python extension gets stuck with the message "Python extension loading...". In the Output section, the following code appears:
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - experiment'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
Error 2021-01-23 12:33:35: Failed to initialize source map support in extension
User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJoinMailingListVar2'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonInstallPylintButtonFirst'
> conda --version
> conda info --json
> python3.7 ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Error 2021-01-23 12:33:37: Detection of Python Interpreter for Command python3.6 and args failed as file does not exist
Error 2021-01-23 12:33:39: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://wsl+ubuntu-20.04/home/ben/.config/Code/User/settings.json' (EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '/home/ben/.config/Code/User/settings.json')
at _handleError (/home/ben/.vscode-server/bin/ea3859d4ba2f3e577a159bc91e3074c5d85c0523/out/vs/server/remoteExtensionHostProcess.js:769:473)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async y.readText (/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/out/client/extension.js:9:344778)
at async p.doesFileNeedToBeFixed (/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/out/client/extension.js:59:500280)
at async /home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/out/client/extension.js:59:499407
at async Promise.all (index 0)
at async p.getFilesToBeFixed (/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/out/client/extension.js:59:499353)
at async p.updateTestSettings (/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/out/client/extension.js:59:498980)] {
code: 'FileNotFound',
name: 'EntryNotFound (FileSystemError)'
}
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py pylint --load-plugins pylint-flask --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/Code/eons-website/eons_backend/eons_data/models.py
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py pylint --load-plugins pylint-flask --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text ~/Code/eons-website/eons_backend/eons_data/models.py
cwd: ~/Code/eons-website
Python interpreter path: ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python
Starting Jedi Python language engine.
> conda --version
##########Linting Output - pylint##########
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.prefix)"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py site --user-site
cwd: ~/Code/eons-website
> ~/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python ~/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py site --user-site
cwd: ~/Code/eons-website
Error 2021-01-23 12:33:40: Failed to get interpreter information for '/home/ben/.pyenv/shims/python3.6' [Error: Command failed: "/home/ben/.pyenv/shims/python3.6" "/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py" "/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/interpreterInfo.py"
pyenv: python3.6: command not found
The `python3.6' command exists in these Python versions:
3.6.12
Note: See 'pyenv help global' for tips on allowing both
python2 and python3 to be found.
at ChildProcess.exithandler (child_process.js:295:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe.<anonymous> (net.js:664:12)] {
killed: false,
code: 127,
signal: null,
cmd: '"/home/ben/.pyenv/shims/python3.6" "/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/pyvsc-run-isolated.py" "/home/ben/.vscode-server/extensions/ms-python.python-2021.1.502429796/pythonFiles/interpreterInfo.py"'
}
I have tried uninstalling the extension and reinstalling it - sometimes this seems to work, but most often it does not. I have also manually deleted all the extension files in '~/.vscode-server/extensions` and that doesn't work either.
It seems to be getting hung up on finding the python3.6
command from pyenv
, but I don't need it to be looking for this executable. The environment I'm working in has its own python executable in ~/.local/share/virtualenvs/<env-name>/bin
, which is currently version 3.8.5
.
This is defined in the local .vscode/settings.json
file:
{
"python.pythonPath": "/home/ben/.local/share/virtualenvs/eons_backend-AMh9NQBG/bin/python",
}
How should I configure the extension to ignore the pyenv
installations of Python?