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

cannot select python interpreter from my venv on WSL #70

Closed
uishon opened this issue May 3, 2019 · 17 comments
Closed

cannot select python interpreter from my venv on WSL #70

uishon opened this issue May 3, 2019 · 17 comments
Labels
extension-issue wsl Issue in vscode-remote WSL

Comments

@uishon
Copy link

uishon commented May 3, 2019

  • VSCode Version:
  • Local OS Version: Windows 10. 1809.
  • Remote OS Version: WSL (Ubuntu 18.10)
  • Remote Extension/Connection Type: WSL

Steps to Reproduce:

  1. set python.venvPath in python extension setting to ~/.virtualenvs (on remote, not user)
  2. try select interpreter from the command palette (or simply click on the interpreter listed on the status bar) - VS code shows a list of interpreters to choose from but not the ones under ~/.virtualenvs.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: Yes/No

@kieferrm kieferrm added the wsl Issue in vscode-remote WSL label May 3, 2019
@ricjuanflores
Copy link

Add to wsl settings:

"python.pythonPath": "~/.virtualenvs/venv_test/bin/python",

@uishon
Copy link
Author

uishon commented May 4, 2019 via email

@uishon
Copy link
Author

uishon commented May 4, 2019 via email

@uishon
Copy link
Author

uishon commented May 4, 2019 via email

@egamma
Copy link
Member

egamma commented May 6, 2019

FYI @qubitron

@qubitron
Copy link

qubitron commented May 7, 2019

@DonJayamanne @brettcannon can you comment on whether the venvPath setting is expected to work here?

@DonJayamanne
Copy link

@uishon

  • When adding "python.venvPath": "~/.virtualenvs" do you not see the environments in WSL or SSH or both?
  • Are there any errors logged in the Console Window accessible from Help-> Toggle Developer Tools menu.

That original remote-ssh window which remained open, however, is still not
showing them all.

Is this still the case?

@uishon
Copy link
Author

uishon commented May 14, 2019 via email

@DonJayamanne
Copy link

@uishon Thanks for getting back to us.
Its most likely the discovery of interpreters was taking a little longer than usual. The way it works is we discover interpreters in the background.

@kieferrm I believe we can consider this issue resolved.

@phtn
Copy link

phtn commented Jun 20, 2019

install Remote - WSL extension.

@sleighsoft
Copy link

Not for WSL but I cannot change my environment on a linux server I am connected to. It properly lists all available conda environments but when selecting one (either from bottom menu / or by "select interpreter") nothing changes.

@brettcannon
Copy link
Member

@sleighsoft are you saying that your Linux server isn't running under WSL?

@sleighsoft
Copy link

sleighsoft commented Jul 4, 2019

Yes, it is an ubuntu server. Not WSL.
And when I login with vscode remote I always defaults to the same conda environment and I cannot choose another one. There is also nothing in any of the remote logs indicating what does or does not happen when I try to change the interpreter.

Edit:
It has now, for whatever reason, unselected the current interpreter and I can no longer choose a new one and therefore not use the debugger :/

Edit 2:
Completely removing the vscode installation on the remote and then reconnecting so that vscode reinstalls itself solved that issue. Seems like one of the previous vscode updates broke it.
Maybe in addition to Kill Server on remote something like Reinstall server on remote would be nice :)

@fangaofeng
Copy link

i open folder with wsl,then File->Preferences-> settings->Remote [WSL:Ubuntu] change my setting, not effect. it effect by local settings.
When i change .vscode/settings.json is same as Remote[WSL:Ubuntu].json, python can run. But it change local file .This Remote settings:

{
    "python.venvPath": "/home/fgf",
    "python.venvFolders": [
        "whlenv"
    ],
    "python.pythonPath": "/home/fgf/whlenv/bin/python",
    //"python.pipenvPath": "E:\\pythonvenv\\trainserver-PFVxFgBL\\Scripts\\pipenv.exe",
    //"python.pipenvPath": "C:\\Python\\Python37\\Scripts\\pipenv.exe",
    "python.terminal.activateEnvironment": true,
    "python.autoComplete.addBrackets": false,
    // "python.linting.flake8Enabled": true,
    "python.linting.pycodestyleEnabled": true,
    "python.formatting.provider": "autopep8",
    "python.formatting.autopep8Args": [
        "--max-line-length",
        "120",
        "--experimental"
    ],
    // "python.sortImports.args": ["-rc", "--atomic"],
    // "python.formatting.yapfArgs": ["--style", "{based_on_style:pep8}"],
    "editor.formatOnSave": true,
    "editor.tabCompletion": "on",
    "python.analysis.logLevel": "Trace",
    "python.analysis.diagnosticPublishDelay": 1000,
    "python.analysis.openFilesOnly": false,
    "python.analysis.symbolsHierarchyDepthLimit": 20,
    //"svn.path": "c:\\Program Files\\TortoiseSVN\\bin",
    "git.ignoreLimitWarning": true,
    "python.autoComplete.extraPaths": [
        "/home/fgf/whlenv/Lib/site-packages"
    ],
    "python.linting.pylintEnabled": false,
    "python.linting.maxNumberOfProblems": 120,
    "files.associations": {
        "**/templates/*.html": "django-html",
        "**/templates/*": "django-txt",
        "**/requirements{/**,*}.{txt,in}": "pip-requirements"
    },
    "emmet.includeLanguages": {
        "django-html": "html"
    }
}

@raeperd
Copy link

raeperd commented Jul 1, 2020

  1. Ctrl + Shift + p
  2. python: Select Interpreter
  3. Choose virtual environment

This was my solution

@bamurtaugh
Copy link
Member

Reviewing this thread - it looks like we can consider the original issue resolved? If folks aren't still experiencing it, I'll go ahead and close it.

@bamurtaugh
Copy link
Member

Closing based on above comment - thanks all!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extension-issue wsl Issue in vscode-remote WSL
Projects
None yet
Development

No branches or pull requests