I am a beginner in python, I want to download a module named pygame, I was told to type pip install pygame in the command prompt, I did it, now when I went back to vscode, and run "import pygame", It says No module named 'pygame'
Things you should check:
In terminal (cmd), type pip list
and check if pygame appears in the list
In terminal (cmd), if you type python
, which version of python shows up?
Check your system path to see where your default python is store on your computer
On vscode check if you are using the same instance of python
You can try to replace pip
with pip3
in all your pip commands and see if it works but sooner or later you will need to take a deeper look on how everything is set up on your computer, this will prevent you some headache along your developer journey
If you are lost and nothing works, I would simply suggest uninstalling python all together, make sure you've uninstall every instance of python on your computer and reinstall it from scratch. Make sure you check "Add to PATH" while installing
You can also look at virtual environement but if you are just starting out with coding and everything related to that, it might be a little too advance especially on windows (if you happen to be on linux this might be a solution it's really easy to set up on linux)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.