简体   繁体   中英

ImportError: No module named pygame

I am trying to run a python program on a raspberry pi that uses pygame and I am getting this error:

Traceback (most recent call last):
  File "newTtest.py", line 3, in <module>
    from pygame import mixer
ImportError: No module named pygame

How do I fix this? Thank you.

in the command line type

sudo apt-get install pygame

that should install it, because pygame isn't already installed on the Raspberry Pi/Debian.

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