简体   繁体   中英

No module named 'pygame' macOS issue

I am trying to install and use pygame on macOS through IDLE. I have used the pip install pygame command and the terminal says that pygame is installed on my computer. However, whenever I use "import pygame" I get an error that says:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pygame
ModuleNotFoundError: No module named 'pygame'

Are you using a virtual environment? Check with pip freeze<\/code> if pygame is installed in your working folder (path). If not, install pygame using pip depending on the version of pip you use.

"

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