-1

I am currently trying to use the match function in python and apparently that is not available in 3.9.12 so I have been trying to update the version is vs code. I have downloaded version 3.11.3 and I have tried to click it in the bottom right of the screen as shown in the picture but I have been unsuccessful as seen in the terminal. Any assistance would be much appreciated.

I tried a few things that I have found and saw a few things talking about a virtual environment but I don't think that is necessary for what I am doing. enter image description here

  • how did you download 3.11.3? if it is not through conda, maybe try exiting the base conda environment by doing conda deactivate, and then run python -V. – myx Jun 14 '23 at 18:39
  • Note that you can't "replace" your system Python version. The MacOS system itself relies on Python 3.9. When you download (did you use homebrew?), that adds an ADDITIONAL Python, usually in /usr/local/bin. You can create an alias in your bash/zsh profile to tht. – Tim Roberts Jun 14 '23 at 18:45
  • Does this answer your question? [How can I change the Python version in Visual Studio Code?](https://stackoverflow.com/questions/48135624/how-can-i-change-the-python-version-in-visual-studio-code) – starball Jun 14 '23 at 20:03
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jun 14 '23 at 21:05
  • Welcome to StackOverflow. If an answer solves your problem you could click '✔' to mark it as an acceptable answer. If it helps you give it an upvote. If the answer is offtopic or doesn’t help at all, downvote or add a comment. See also [stackoverflow.com/help/why-vote](https://stackoverflow.com/help/why-vote) – JialeDu Jul 07 '23 at 01:28

1 Answers1

0

Is your python 3.9 the conda environment base? Now your terminal has activated base environment. You should exit or close the terminal before using python311.

If you execute the script with the Python extension then it automatically changes the terminal to use the python version shown on the bottom right.

enter image description here

You can verify the currently used interpreter with the following code

import sys
print(sys.executable)

You should read:

JialeDu
  • 6,021
  • 2
  • 5
  • 24