简体   繁体   中英

unable to download pygame module in python

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:

  1. In terminal (cmd), type pip list and check if pygame appears in the list

  2. In terminal (cmd), if you type python , which version of python shows up?

  3. Check your system path to see where your default python is store on your computer

  4. On vscode check if you are using the same instance of python

  5. 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

  6. 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

  7. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM