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

Command select python interpreter doesn't list all of the installed python interpreters on system, including those on virtual environment #56

Closed
tangorboyz opened this issue Nov 13, 2017 · 14 comments · Fixed by #219
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@tangorboyz
Copy link

tangorboyz commented Nov 13, 2017

Environment data

VS Code version: 1.19.0-insider
Python Extension version: 0.8.0
Python Version: 2.7.12, 3.5.2, 3.6.3
OS and version: Ubuntu 16.04

Actual behavior

As I mention above, I have three python version installed on my computer, but the only python that shows up when running command python: select interpreter is python 2.7.12. See picture bellow.
Extension also will only list python 2.7.12 + the one that I already set on workspace configuration file (manually).

image

Expected behavior

It should list all three python version, including those that running on virtual environment

@theHamsta
Copy link

theHamsta commented Nov 13, 2017

I can confirm this issue.

Reason for this problem seems to be that the plug-in is looking for a python interpreter with the exact name "python", i.e. python3 is not found. If I create a symbolic link to "python3" with the name "python" (let's say ~/bin/python where ~/bin is in my $PATH) the interpreter can be selected again.

@DonJayamanne
Copy link

DonJayamanne commented Nov 13, 2017

@tangorboyz Currently the extension lists Python interpreters located in the current PATH.
E.g. Python3 would be listed only if it is in the current path.

As for virtual environments, currently we only search for Virtual environments in the following locations:

  • ~/Envs, ~/.virtualenvs, ~/.pyenv, ~/.pyenv/versions

exact name "python", i.e. python3 is not found

@theHamsta, This is not true, the extension looks for python and python<number>.
python3 will be detected, provided it is in your current PATH.
Please could you confirm that python3 is in your current path (prior to creating the symbolic link).

Finally, you can augment the search path by editing the following setting in your settings.json file to point to the virtual environment directory containing the python interpreter:

"python.venvPath": "Path to the virtual env"

@tangorboyz
Copy link
Author

tangorboyz commented Nov 13, 2017

All my pythons are in my PATH. I could invoke each of them from terminal. E.g: for python 2.7.12, i call it with python, and for python 3.5, with python3, and python 3.6 with python3.6. The previous version of python extension could list all of of them. I don't know why the current version couldn't.
If a check with which:

  • which python: /usr/bin/python
  • which python3: /usr/bin/python3
  • which python3.6: /usr/bin/python3.6

@DonJayamanne
Copy link

@tangorboyz thats interesting. It python3 work at my end on ubuntu.
Could you try the following:

  • Quit vscode (ensure all instances are closed, please check if running in the background)
  • Start vscode
  • Test once again

@tangorboyz
Copy link
Author

no luck.

@DonJayamanne
Copy link

Please could you try this in the standard version of VS Code (instead of the insiders build).
Thanks

@bgse
Copy link

bgse commented Nov 13, 2017

Can confirm the issue @tangorboyz has, same on my end.

Version 1.18.0
Commit dcee2202709a4f223185514b9275aa4229841aa7
Date 2017-11-08T12:44:48.751Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Maybe related, this pops up roughly 1-2 seconds after selecting the command and showing the selection dialog:

vscode-python-console

@tangorboyz
Copy link
Author

I have tried it on standard version (1.18.0), the result same as insider.

@DonJayamanne
Copy link

@bgse the error you are seeing is related to ctags (you could either install ctags to get rid of this or disable workspace symbols).

@bgse what's your OS and Python version?

@DonJayamanne
Copy link

@tangorboyz looks like I'm missing something fairly obvious here as this issue has been reported by two others now.

@tangorboyz
Copy link
Author

Looks, like it's a regression. I've tried to install the previous version (0.7.0), from the old repository. And It could list all python version installed on my computer:

image

@DonJayamanne
Copy link

@tangorboyz please could you confirm there are no errors logged in the console window.
Please go into the menu Help->Toggle Developer Tools.
Something must be in there.

@DonJayamanne
Copy link

DonJayamanne commented Nov 14, 2017

@tangorboyz never mind, i've identified the bug. Thanks for the info

@DonJayamanne DonJayamanne added the bug Issue identified by VS Code Team member as probable bug label Nov 14, 2017
@tangorboyz
Copy link
Author

I don't know if this could help, but:

workbench.main.js:sourcemap:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
    at t._tryExecuteCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1111105)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110944
    at n.Class.define.cancel.then (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:70382)
    at t.executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110918)
    at e.$executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2847469)
    at t.e.invoke (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2902414)
    at e._invokeHandler (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481583)
    at e._receiveOneMessage (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481273)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2480300
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2482219
e.onUnexpectedError @ workbench.main.js:sourcemap:10
(anonymous) @ workbench.main.js:sourcemap:10
e.onUnexpectedError @ workbench.main.js:sourcemap:9
o @ workbench.main.js:sourcemap:9
e.$onUnexpectedError @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e._invokeHandler @ workbench.main.js:sourcemap:9
e._receiveOneMessage @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e.fire @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
workbench.main.js:sourcemap:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
    at t._tryExecuteCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1111105)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110944
    at n.Class.define.cancel.then (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:70382)
    at t.executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110918)
    at e.$executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2847469)
    at t.e.invoke (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2902414)
    at e._invokeHandler (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481583)
    at e._receiveOneMessage (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481273)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2480300
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2482219
e.onUnexpectedError @ workbench.main.js:sourcemap:10
(anonymous) @ workbench.main.js:sourcemap:10
e.onUnexpectedError @ workbench.main.js:sourcemap:9
o @ workbench.main.js:sourcemap:9
e.$onUnexpectedError @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e._invokeHandler @ workbench.main.js:sourcemap:9
e._receiveOneMessage @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e.fire @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
workbench.main.js:sourcemap:10 command 'python.updateFeedbackCounter' not found: Error: command 'python.updateFeedbackCounter' not found
    at t._tryExecuteCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1111105)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110944
    at n.Class.define.cancel.then (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:70382)
    at t.executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:1110918)
    at e.$executeCommand (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2847469)
    at t.e.invoke (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2902414)
    at e._invokeHandler (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481583)
    at e._receiveOneMessage (file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2481273)
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2480300
    at file:///usr/share/code-insiders/resources/app/out/vs/workbench/workbench.main.js:9:2482219
e.onUnexpectedError @ workbench.main.js:sourcemap:10
(anonymous) @ workbench.main.js:sourcemap:10
e.onUnexpectedError @ workbench.main.js:sourcemap:9
o @ workbench.main.js:sourcemap:9
e.$onUnexpectedError @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e._invokeHandler @ workbench.main.js:sourcemap:9
e._receiveOneMessage @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
e.invoke @ workbench.main.js:sourcemap:9
e.fire @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560
workbench.main.js:sourcemap:9 [Extension Host] (node:27046) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. (at process.on (internal/process/warning.js:21:17))
t.log @ workbench.main.js:sourcemap:9
t._logExtensionHostMessage @ workbench.main.js:sourcemap:9
(anonymous) @ workbench.main.js:sourcemap:9
emitTwo @ events.js:106
emit @ events.js:194
process.nextTick @ internal/child_process.js:766
_combinedTickCallback @ internal/process/next_tick.js:73
_tickCallback @ internal/process/next_tick.js:104

That's from insider.
And this from standard version:

extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-python.python-0.8.0]: Command `jupyter.runSelectionLine` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-python.python-0.8.0]: Command `jupyter.execCurrentCell` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-python.python-0.8.0]: Command `jupyter.execCurrentCellAndAdvance` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-python.python-0.8.0]: Command `jupyter.gotToPreviousCell` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-python.python-0.8.0]: Command `jupyter.gotToNextCell` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-vscode.cpptools-0.14.2]: Command `workbench.action.gotoSymbol` appears multiple times in the `commands` section.
extensionService.ts:441 [/home/dhawu/.vscode/extensions/ms-vscode.cpptools-0.14.2]: Command `workbench.action.showAllSymbols` appears multiple times in the `commands` section.
console.ts:123 [Extension Host] vscode-icons is active!

@DonJayamanne DonJayamanne added this to the December 2017 milestone Nov 17, 2017
DonJayamanne added a commit that referenced this issue Dec 14, 2017
* 'master' of https://github.com/Microsoft/vscode-python:
  Fixes #56 list all environments (#219)
  Fixes #57 Disable activation on debugging (#220)
  Fixes #26 Do not run linters when linters are disabled (#222)
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants