Hello! I did not know if here was the right place but here I am. Long story short, on my laptop running Linux, I have 2 versions of python (3.7.17 and 3.12.3) my terminal always defaults to 3.12.3 for pip, python3 and python. Does anyone know how to make it use the VSCode Python Extension selected interpreter version? Iv tried ChatGPT but it's no help
#π VSCode terminal not using selected python interpreter for command
30 messages Β· Page 1 of 1 (latest)
@quartz apex
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
Give more info please. What distro are you running? I think that there is a plugin of VS Code that lets you switch installs. (I am not sure) I am a PyCharm user.
ctrl-shift-p
Distro? Like Linux version and stuff?
Also VSCode Python Extension lets you change the interpreter, which along with enabling "python.activateTerminal", it should supposedly set the "python" command to the path of whatever version of python you set as the interpreter, but for me it doesnt
No clue how this helps
Yes
Yes its a pallette. Search switch or something. I guess its a bug. See the patch notes of vs code. Try updating VS Code.
everything is all up to date. i believe its been an issue for a bit now
You have the correct version at the right bottom corner of the screen and it's not using that?
Yup. I have it on 3.7.13 but "python3 --version" and "pip -V" is 3.12.3, and "python" command doesn't exist supposedly
Just to be sure, you are opening a new terminal in vscode after selecting the version?
Yup, IV opened up several new terminals in vscode
Click on the "output" tab, select "Python" and check for any errors when changing interpreters
Also, what shell are you using?
Bash
Will do when I next touch it
this is all that outputs when I changed from 3.7.17 to 3.12.3, then back to 3.7.17
close ur terminals im vscode and open a new ome anytime your switch versions..
then do,
which python
try python3
python3 does not change dependant on interpreter though. python3 always leads to 3.12.3 since the "python3" file is just a link to "python3.12" (Linux Mint does that, changing it messed my whole system up π )
that says to me your using default system.. here you do python --version to verify..
read the msg about.. i onno how you installed multiple versions.. but could be borked.. may have to rebuild .. there are tutorials for installing multiple versions...
agai, python3 for u
I can't lie, I did not understand most of that. But I also had the same issue on my windows PC.
Locations on pc (I believe):
C:/%localappdata%/Programs/Python/Python37/python.exe
C:/%localappdata%/Programs/Python/Python312/python.exe```
Locations on Linux:
/usr/bin/python3.7
/usr/bin/python3.12
/usr/bin/python3->python3.12
maybe go look at yhose folders and see what the structure is.. Im imagining..
/usr/bin/python3.7/bin
no folders
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.