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

Not listing all Python interpreters on PATH named python.exe #2398

Closed
pjkottke opened this issue Aug 15, 2018 · 9 comments · Fixed by #2575
Closed

Not listing all Python interpreters on PATH named python.exe #2398

pjkottke opened this issue Aug 15, 2018 · 9 comments · Fixed by #2575
Assignees
Labels
feature-request Request for new features or functionality

Comments

@pjkottke
Copy link

Environment data

  • VS Code version: 1.27.0-insiders
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Various
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: Python 3.4.4

Actual behavior

Third party programs (Plaxis) has installed Python, but these versions are not shown in the intepreter selection unless they are first in the list from the Windows Path Environmental Variable. If I change the order, once again only the first listed path is shown.

Expected behavior

All Python interpreters in the Path should be shown.

Steps to reproduce:

  1. Have multiple Python interpreters installed under Program Files.
  2. Reorder PATH to only shown the first version in VS Code.

Order A:
order_b
Result A:
result_b

Order B:
order_a
Result B:
result_a

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug needs verification labels Aug 15, 2018
@brettcannon brettcannon added info-needed Issue requires more information from poster and removed needs verification labels Aug 20, 2018
@brettcannon
Copy link
Member

What Python version are these distributed Python interpreters? And do they only expose python or do they also have e.g. python3 and python3.7 (i.e. a binary with the major version and a binary with the major and minor version)?

@pjkottke
Copy link
Author

Sorry for the delay.

Python 3.4.4 and Python 3.4.5.

Both directories have "python.exe" and "pythonw.exe" but no other executables in the root.

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Aug 28, 2018
@brettcannon brettcannon changed the title Not All Interpreters Shown Not listing all Python interpreters on PATH named python.exe Aug 28, 2018
@brettcannon
Copy link
Member

OK, so the problem is most likely that we don't search every entry for python on PATH, just the first one (probably need to check if this is Windows-only or if we do the same thing on UNIX). And on top of that these interpreters are most likely not registering themselves in the registry, so finding them through PATH is the only way to list them.

@pjkottke
Copy link
Author

pjkottke commented Aug 28, 2018

Will the extension find all the python in the registry? Is there a way for me to add these third party python to the registry?

That is probably not the best way, since I will end up having multiple Python 3.4's.

@brettcannon
Copy link
Member

@pjkottke we will find all Python installs registered in the registry, but I don't know exact details of what to set to make them appear (there's a PEP specifying it all).

@pjkottke
Copy link
Author

pjkottke commented Aug 29, 2018

OK, I will muck around with that tomorrow - hopefully that works as a temporary fix.

That worked great, and fixes my issue for the present.

@brettcannon brettcannon reopened this Aug 30, 2018
@brettcannon
Copy link
Member

brettcannon commented Aug 30, 2018

I'm re-opening so we can make sure we are searching all of PATH so we can get a proper fix.

@brettcannon
Copy link
Member

Can you verify this, @ericsnowcurrently ?

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality needs PR and removed needs verification bug Issue identified by VS Code Team member as probable bug labels Sep 12, 2018
@DonJayamanne
Copy link

DonJayamanne commented Sep 12, 2018

I'm re-opening so we can make sure we are searching all of PATH so we can get a proper fix.

This is an enhancement not a bug, looking for interpreters in ALL directories in the PATH was never the plan.
I can verify this will not work as we do not iterate through all directories in the PATH to look for python interpreters.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 17, 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

Successfully merging a pull request may close this issue.

4 participants