I am a complete beginner at Python and am going through the CS50P tutorial. The tutorial just went through match commands, and as I tried to run a program including match on VS Code an error message appeared telling me that I do not have a version of Python that supports match. How can I get Python 3.10 on VS?
I have tried going through the VS Code gui but haven't had any luck. Because of my extreme inexperience I am just assuming that I am looking in the wrong places.
CodePudding user response:
Follow this steps(hope will help you):
- Download python from the official website python website and chose the version you want
- Make sure you add python to the virtual environment by clicking (add python to environment variable) like this image setup python.
- After that go to VSCode and install the python extension.
- Open the python file now we can see the python version button next to the python button in VSCode lower bar just click it and a will popup window to choose Interpreter now click (Enter interpreter path) then (Find).
- Now go to the path where python is installed and chose (python.exe) to find the python path just type (where python) in cmd if you're using Windows.
CodePudding user response:
You should look into Conda. It makes working with different versions of python easy.
With conda installed this task would be as easy as:
conda create -n py310 python=3.10
Then just tell VS to use py310 environment.