Skip to content

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

Closed

Description

@neverfox

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 (View→Output, 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

Activity

  1. brettcannon commented on Apr 3, 2018

    @brettcannon
    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?

  2. neverfox commented on Apr 5, 2018

    @neverfox
    Author

    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).

  3. gbonline commented on Apr 6, 2018

    @gbonline

    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

  4. neverfox commented on Apr 6, 2018

    @neverfox
    Author

    Gbonline (@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.

  5. gbonline commented on Apr 7, 2018

    @gbonline

    Roman Pearah (@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

  6. brettcannon commented on Apr 9, 2018

    @brettcannon
    Member

    Gbonline (@gbonline) you're looking for #1192

  7. brettcannon commented on Apr 9, 2018

    @brettcannon
    Member

    Roman Pearah (@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).

  8. neverfox commented on Apr 10, 2018

    @neverfox
    Author

    Brett Cannon (@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 George Leslie-Waksman (@gwax)'s experience.

  9. brettcannon commented on Apr 10, 2018

    @brettcannon
    Member

    Roman Pearah (@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.

  10. neverfox commented on Apr 10, 2018

    @neverfox
    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.

  11. neverfox commented on Apr 11, 2018

    @neverfox
    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.

  12. locked as resolved and limited conversation to collaborators on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions