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

Python: Select Interpreter doesn't list all pyenv interpreters #1281

Closed
neverfox opened this issue Apr 3, 2018 · 11 comments
Closed

Python: Select Interpreter doesn't list all pyenv interpreters #1281

neverfox opened this issue Apr 3, 2018 · 11 comments
Labels
feature-request Request for new features or functionality

Comments

@neverfox
Copy link

neverfox commented Apr 3, 2018

Environment data

  • VS Code version: 1.21.1
  • Extension version (available under the Extensions sidebar): 2018.3.1
  • OS and version: OS X 10.13.3
  • Python version (& distribution if applicable, e.g. Anaconda): Multiple
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv(-virtualenv)
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

See #363 (comment)

Expected behavior

All pyenv (and pyenv virtualenvs) interpreters should appear in list of interpreters.

Steps to reproduce:

  1. With multiple pyenv versions and virtualenvs, run pyenv versions to get a list of all versions
  2. View list from "Python: Select Interpreters"
  3. Notice that the list in VSCode is incomplete

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

N/A, only contains linting output

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

None

@brettcannon
Copy link
Member

Based on your comment on the other issue, we are detecting all of the intepreters installed by pyenv, just not the virtual environments you created with pyenv-virtualenv, correct?

@brettcannon brettcannon added feature-request Request for new features or functionality info-needed Issue requires more information from poster feature-interpreter labels Apr 3, 2018
@neverfox
Copy link
Author

neverfox commented Apr 5, 2018

The issue is that you're detecting all of the non-virtual interpreters and some of the virtual ones, when what I believe is expected is that all of both kinds would be listed. It seems to be arbitrarily excluding two of them in the example from that comment. All of them are pyenv-created and there's no difference in the way the listed one was created from the way the excluded ones were created (save for the name).

@gbonline
Copy link

gbonline commented Apr 6, 2018

Hi, I've the same issue on mac.
When I've defined the python.venvPath on Settings->Python section, I could see the list of my venvs,
but from the last updates of VSCode, I can't get the venvs list from cmd+shift+P:Select Interpreter.
I get only the system installation, I have only virtualenv generated envs
Looking around I found that opening a terminal,
then activating a virtual env with "workon mypyenv"
and then start VSCode with "code -a ."
I can see the active virtual env on venvs list

@neverfox
Copy link
Author

neverfox commented Apr 6, 2018

@gbonline That does sound frustrating, however I want to make sure not to confuse the issues, as the one I'm brining up is specifically pyenv-related (whereas it looks like you're using virtualenv-wrapper) and doesn't involve the venvPath setting. I might suggest filing a separate issue? Best of luck with your problem.

@gbonline
Copy link

gbonline commented Apr 7, 2018

@neverfox
I read that this issue was for pyenv, but when I started using VSCode for python, I looked for the virtualenv settings on VSCode and found to set the venvPath. Then it worked for the project I did in October. I could see all my venvs under the my venv common path. and also change venv clicking on the blue status bar on the bottom of the window app.
After the last updates of VSCode, this behavior disappeared and now I can see only the system python env

@brettcannon
Copy link
Member

@gbonline you're looking for #1192

@brettcannon
Copy link
Member

brettcannon commented Apr 9, 2018

@neverfox So you're saying we actually detect some of the virtual environments created using pyenv-virtualenv? I'm honestly surprised we pick up any without a configuration setting since we only pick up virtual environments in your workspace folder or if you have a Pipfile and so we know to go look for pipenv, hence why I want to make sure I understand exactly what is going on (GIF showing the issue would be awesome).

@neverfox
Copy link
Author

neverfox commented Apr 10, 2018

@brettcannon Yes, some are picked up and some aren't. Did you see the screenshot and pyenv output I posted in the other issue? My expectations here were somewhat set by @gwax's experience.

@brettcannon
Copy link
Member

@neverfox I did see it, but that window can be scrollable so it's non-obvious if that's the complete list or not.

Regardless, we think we might know the cause and fixed it in #1353 . If you have time, please try out the development build of the extension and see if this solves your problem.

@brettcannon brettcannon added validate fix and removed info-needed Issue requires more information from poster labels Apr 10, 2018
@neverfox
Copy link
Author

Yeah, I thought you might wonder about that. I did scroll for sure and it's not complete. I will check out the dev build, thanks.

@neverfox
Copy link
Author

The alpha version appears to list all interpreters in pyenv. Now if there's ever a solution to #1167, pyenv users will be mostly set.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants