-
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
command 'python.setInterpreter' not found #14959
Comments
It's likely that the Python extension has not been activated. Please open a python file to activate the extension, the commands should be available after that. |
Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. If you think your issue is more of a question or configuration problem rather than a bug, please ask on Stack Overflow with the Thanks for your understanding and patience! |
I don't understand what you mean. I've been coding Python for months. This happened out of the blue one day when I was trying to execute .py scripts (normally there's the green arrow button on the top right as well), so I suspect the latest update caused the issue. I am trying to rollback to an older version of the extension. |
Yep. I installed v2020.10.332292344 (from 1 month ago) and everything is back to normal. Seeing as the issue started happening yesterday, it's most likely something to do with the new release that came out on 14th Dec, but then someone else posted this on 7 Nov also so maybe that one already has the issue. |
@linminhtoo Can you check the following folder Also can you check your settings, are you using |
I deleted all folders of |
@linminhtoo Are you by chance installing using VSIX manually? if so, can you verify you also have |
Happens to me as well:
Pylance language server, Python 3.9 (Trying to set a virtual environment). |
@bharel Try the following. If that does not help create a new bug. Do the following to remove stale versions of the extension:
|
@karthiknadig I've installed VS code 4 days ago, on a fresh system. I'm not sure I have a "stale version". I did install an older extension version though and it solved the problem. @linminhtoo did that as well and it worked for him. |
Happens also to me. Tried removing old version from Version: 1.53.0 Python extension version v2021.1.502429796 In my case this does not allow me to select the pipenv virtual environment, and then I don't have the dependencies for my project, which implies that autocomplete features are not working. EDIT: Tried again with v2020.10.332292344 and it works perfectly. |
Same issue here. I'm running code-server, its a totally clean install onto a clean install of Ubuntu Server 20.04 so I can 100% rule out any issues with multiple versions of the extension. Python is, quite literally, the first and only extension I have ever installed. I installed it from the built in extension page and all prerequisites are installed. Here's the info from Help > About
Edit - Fixed but I had to roll the python extension all the way back to v2020.10.332292344 |
@Dungeonseeker Rolling the python extension back to v2020.10.332292344 worked for me too |
If In 2020.11 we split the python into two extensions the |
I installed the |
@lyndonchan Try |
@karthiknadig same problem after trying |
@lyndonchan Can you share the dev tools logs? (Help > Toggle Developer Tools) |
|
@lyndonchan what is your version of VS Code? Make sure it is at least 1.52 or greater. |
@karthiknadig it's 1.53 |
@DonJayamanne @rchiodo Can you take a look at why |
@rchiodo I suppose it isn't fully installed. This is what I see: |
I'd delete that folder then and reinstall from the marketplace. |
Delete the entire extension folder that is. |
@karthiknadig Thank you, this was the issue for me. Can you please make it so that the extension gives some kind of error/warning that Jupyter package is missing? I've read all the logs and I couldn't find what was wrong before I googled the issue. |
Same problem here with I have re-installed I have opened a python file, and run "Python: Select Interpreter". I got this error: I have no Python value in the drop-down in the Output panel to display any logs. About my local python versions (I don't know if it helps), i ran this in the vscode terminal tab:
Solution: I have to reverted back |
@Lestt was there nothing in the dev tools Logs? (Help > Toggle Developer Tools) |
Read through all the posts. I am running Mojave on a MacBook Pro. My jupyter folder had the correct extension.js file. What seems really odd to me is I was using VSCode running a Python script a few weeks ago and everything was fine. But yesterday I went to run the same script and it failed. I haven't made any changes to my Python3 installation. Debugging led me to the error the interpreter was not loading and I noticed that it wasn't showing up in the bottom left of the status bar either (as others have reported). Reverting the ms-python.python extension to 2020.10.332292344 solved the issue. Any ideas why this is happening @linminhtoo ? |
@ctphillips Check the developer console, and python logs. Developer console can be found here Help > Toggle Developer tools. and Python logs at Output > Python panel. If the extension did not load then you won't see Python in the possible options to select in the output panel. |
@karthiknadig There is nothing in the Output > Python panel if I am looking in the correct location. I assume you mean the Output that can be reached by View -> Output. I also don't see anything in View -> Problems (It simply says "No problems have been detected in the workspace"). In the Help -> Toggle Developer tools I do see some errors and warnings. Interestingly, I see errors with v2020.10.332292344 (which eventually works) and v2021.2.636928669 (which doesn't work). In both cases, after opening vscode and it begins to load a python project, I get a warning in the bottom right of the workspace:
When I click on the button: Enable it and Reload Window, the v2020.10 version loads the python interpreter and the v2020.2 never does. Looking at the error log in the Developer Tools in v2020.2 (after enabling the Microsoft Python Language Server) I see the following errors:
In addition to the errors there are 5 warnings 4 of which seem to be related to the same issue
So I am wondering why the Extension Host is not able to write to the user settings. Maybe that is the root cause, which produces the errors? Thoughts? Next steps? |
Okay. In the end, most of these errors were due to a typo in my user settings file. :-( There is still one warning and one error remaining the Developer Console, but I am not seeing an obvious effects of the problem. warning: error |
Thank you for this version recommendation. |
If Another thing is to ensure that everything is getting loaded correctly. VS Code recently had a problem where it would fail to extract the downloaded extension packages completely. Partial install meant that files were left out, and it shows as errors like For anyone running into this issue, if you are done the two things I mention above (install jupyter and there are not errors in developer console indicating missing files), then please file a separate bug. Closing this, since this particular issue should be addressed by steps described here. |
When I had the same problem, my problem was because of the jupyter that the python extension needs, I just updated it and it worked. |
Environment data
python.languageServer
setting: Jedi[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
After doing CTRL+SHIFT+P, I want to select Python Interpreter
Actual behaviour
Command 'Python: Select Interpreter' resulted in an error (command 'python.setInterpreter' not found)
So I cannot run any python scripts within vscode
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
How can I retrieve detailed logs?
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: