-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 not installed" diagnostic despite showing an interpreter in the status bar #11870
Comments
Hi @basharatusman, thank you for reaching out. How did you install python?
Do you create the folder from within VS Code? Can you also copy here the output for Last but not least, can you try installing an older version of the extension (for example You can follow the prompts from "Extensions: Install Specific Version of Extension..." in the command palette: Or you can open the extensions side bar, click on the settings for the Python extension and pick "Install Another Version...": Thank you! |
@kimadeline thank you for the response.
Here is the output for python. Quick note - I have started using Conda instead of Venv since the original post.
|
I couldn't reproduce your issue following the steps you outlined: It looks like there's some race condition happening though, because the logs you copied show that an interpreter is found:
Can you try rolling back to even older versions of the extension (2020.3.71113, 2020.3.69010, or even 2020.2.64397) so we can pinpoint when this behaviour was introduced? |
The issue starts at 2020.3.71113. If i roll back to 2020.3.69010 or earlier then I don't get the error. |
I have the same problem, I couldn't fix it. It makes no harm, you can just dismiss the dialog but it is quite annoying. It happened after I updated to the latest VS Code and selected 'Jedi' as my default engine server. Version: 1.45.1 My system: |
@kimadeline Thanks! Install an older python extension version(2020.4.76186) solved my problem. It seems that the latest python extension has bugs that cannot find a python interpreter even I reset the python path in settings and my project settings. |
Seems like a race condition in the extension 🤔 Possible solutions (not in any particular order, I personally prefer option 2):
with let hasInterpreters = await interpreterService.hasInterpreters;
if (!hasInterpreters) {
hasInterpreters = (await interpreterService.getInterpreters()).length !== 0;
}
to return this._hasInterpreters.promise;
if (!this._hasLooked) {
this.getInterpreters().ignoreErrors(); // Run in the background.
}
return this._hasInterpreters.promise;
|
We released a fix for this, but if people are still having issues please do let us know. |
@odddemid What is the version of the Python extension that's installed? edit: @odddemid try reloading the window, and if it doesn't work please open a separate issue since it's different from what others in this thread are experiencing (you have the "Select Python Interpreter" message in the status bar, meaning that the extension didn't detect any interpreter at all). Thank you! |
Maybe this will help someone, VSCode did not see the folder "usr/local/bin", I opened the terminal, entered the command "code /" after which the system showed a notification requesting access to the disk, network folders, desktop, etc. I gave full access rights and after that I got a list of possible versions of python. Unexpected solution to my problem, I don’t understand why VSCode didn’t request access rights when opening it for the first time |
Closing as fixed. Let us know if you have any issues and we'll reopen. |
This issue seems to have reappeared with the latest release of the extension. Rolling back to the previous version of the extension seems to fix the issue. |
Can confirm that the latest version of the Python extension has this problem. Fixed using @dehan-jl's suggestion. |
@dehan-jl @ZhiJianTan Can you guys please reinstall the latest version of the extension & provide the logs? I'm suspecting to see something similar to #13581. Output for
|
I stumbled upon the same question.
|
@Soban06 Can you please send the information I asked earlier #11870 (comment)? |
#13945 (comment) |
Encountered same issue in latest version. Same fix (deleting extension folder and install again) worked. #13945 (comment) |
@kimadeline I came here from 9576. I was having the same problem as folks on that issue. So, I tried your suggestion of installing an older version of Microsoft Python extension and yay! VScode not only recognizes my globally installed python, but also any of my virtual env versions with no problem. Thank you! My OS is Ubuntu 20.04 LTS and I remember updating my OS with some vscode upgrades very, very recently. Basically, going back about a month back in terms of the Microsoft python extension's version allows python to be recognized by vscode. |
Environment data
Expected behaviour
Be able to create a folder or workspace for Python projects.
Actual behaviour
Popup error saying that Python is not installed.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
I just started using VSCode. I installed the Python Extension (2020.5.78807). I have python 3.8.0 installed. I can confirm that by running python --version in the terminal in VSCode. The interpreter in the bottom left of the screen shows as 3.8.0. Command pallet shows the same interpreter.
I can create a new file and save it as a .py and it works with no issues. However, if I create a folder or a workspace and then create a file in that, I get a popup saying that Python is not installed (source: Python(Extension).
The code still seems to run ok. I tried uninstalling and reinstalling the extension but no luck. Any thoughts on how I can get rid of this error?
The text was updated successfully, but these errors were encountered: