Closed caleb15 closed 4 years ago
Also of note is that in the version bar at the bottom of VSCode it incorrectly shows the version as Python 3.6.8 64-bit ('.pyenv': pyenv)
And because there is huge amount of logs in the console logs here is what probably is the relevant section:
Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by CondaEnvService are of count 0
3console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by KnownPathsService are of count 10
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by CurrentPathService are of count 5
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Selected Interpreter from workspaceEnvs, Nothing Selected
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Interpreters returned by VirtualEnvService are of count 3
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: true
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Hide locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: All locators have completed locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Current value for rule system is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"/usr","fileHash":"4a74d3903c79a87b08f6001fa9ddf5e137a75d73a7101d8ee065fde1ca21121093865ee842472e19ae3df71190085628c87b338c637cbb852aa15b6413b29383","type":"Unknown","displayName":"Python 3.6.8 64-bit"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Current value for rule currentPath is {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"/usr","fileHash":"4a74d3903c79a87b08f6001fa9ddf5e137a75d73a7101d8ee065fde1ca21121093865ee842472e19ae3df71190085628c87b338c637cbb852aa15b6413b29383","type":"Unknown"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"/usr","fileHash":"4a74d3903c79a87b08f6001fa9ddf5e137a75d73a7101d8ee065fde1ca21121093865ee842472e19ae3df71190085628c87b338c637cbb852aa15b6413b29383","type":"Unknown"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: setGlobalInterpreter, Class name = f, completed in 3ms, Arg 1: {"architecture":3,"path":"/usr/bin/python3","version":{"raw":"3.6.8-final","major":3,"minor":6,"patch":8,"prerelease":["final"],"build":[],"version":"3.6.8-final"},"sysPrefix":"/usr","fileHash":"4a74d3903c79a87b08f6001fa9ddf5e137a75d73a7101d8ee065fde1ca21121093865ee842472e19ae3df71190085628c87b338c637cbb852aa15b6413b29383","type":"Unknown"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Rule = cachedInterpreters, result = exit
console.ts:134 [Extension Host]
As you can see above somehow it chooses /usr/bin/python3
as the python path
Please run the following in your terminal and let me know what you get:
> which python
> which python3
> python3 --version
> /home/caleb/.pyenv/shims/python3 -c "import sys;print(sys.executabale)"
> /home/caleb/.pyenv/shims/python3 ---version
Please ensure you run this in the same instance of shell.
The results are the following:
python: aliased to python3
/home/caleb/.pyenv/shims/python3
Python 3.6.4
/home/caleb/.pyenv/versions/3.6.4/bin/python3
Python 3.6.4
Looks like you have a funky setup.
If you go back to your original issue post and have a look at the Expected behaviour
, then python3 --version
prints out Python 3.7.4
, however in the previous comment its printing 3.6.4
.
Please double check your environment, its obvious something isn't right at your end. As python3 --version
is returning different values at different points in time.
If you go back to your original issue post and have a look at the Expected behaviour , then python3 --version prints out Python 3.7.4, however in the previous comment its printing 3.6.4.
That's because in the expected behavior section I'm not in my virtual directory.
If I run outside my virtual directory the results are:
python: aliased to python3
/home/caleb/.pyenv/shims/python3
Python 3.7.4
/home/linuxbrew/.linuxbrew/opt/python/bin/python3.7
Python 3.7.4
If I run outside my virtual directory the results are:
I'm confused. In the section above you have indicated this isn't in a virtual environment.
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Are you mixing the two of pyenv
and virtual envs
?
Sorry for asking these questions, however I'm confused with your setup.
Please note, if the terminal returns Python 3.6.4
(thats out side of control of the extension), then the extension will also get the same information. I.e. the extension is returning the same information you get when you're in a terminal.
As you've mentioned If I run outside my virtual directory the results are:
, this leads me to believe that you are manually running some steps (to activate the environment in the terminal), and the extension is not seeing this environment as its not configured as a global setup.
If this is the case, unfortunately we do not support such a setup.
Please ensure it is configured as a global/default environment so the shim
is detected globally, without having to activate it every time.
I believe this is necessary in the case of pyenv due to the way the shims
are dynamically pointed to different executables.
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off.
Environment data
"python.jediEnabled"
set to; more info #3977): JediExpected behaviour
When hardcoding the python path to
/home/user/.pyenv/shims/python3
that python should be used.The above path is python version 3.7.4:
Actual behaviour
It's used in the terminal
But when running tests
/usr/bin/python3
is used instead:Steps to reproduce:
"python.pythonPath": "/home/user/.pyenv/shims/python3",
. Replace user with your user./home/user/.pyenv/shims/python3
-Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)Console Logs
[Extension Host] debugger listening on port 12865 console.ts:134 [Extension Host] (node:22953) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. t.log @ console.ts:134 $logExtensionHostMessage @ mainThreadConsole.ts:38 _doInvokeHandler @ rpcProtocol.ts:394 _invokeHandler @ rpcProtocol.ts:379 _receiveRequest @ rpcProtocol.ts:299 _receiveOneMessage @ rpcProtocol.ts:226 _protocol.onMessage.e @ rpcProtocol.ts:101 fire @ event.ts:558 a @ ipc.net.ts:421 e @ ipc.net.ts:428 fire @ event.ts:558 _receiveMessage @ ipc.net.ts:715 S._socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:578 fire @ event.ts:558 acceptChunk @ ipc.net.ts:236 _register._socket.onData.e @ ipc.net.ts:197 t @ ipc.net.ts:28 emit @ events.js:182 addChunk @ _stream_readable.js:283 readableAddChunk @ _stream_readable.js:264 Readable.push @ _stream_readable.js:219 onStreamRead @ internal/stream_base_commons.js:94 console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 1ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 2ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Create file systemwatcher with pattern */python console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Create file systemwatcher with pattern */*/python console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined console.ts:134 [Extension Host] Info Python Extension: 2019-08-05 13:59:28: Register Intepreter Watcher, Class name = p, completed in 4ms, Arg 1: