简体   繁体   中英

Trouble installing Pygame

I am having difficulty installing Pygame on Python 3.8 (MacOS)

When I attempt to run install hg+http://bitbucket.org/pygame/pygame , I get the following error message:

Installing collected packages: pygame
 Running setup.py install for pygame ... error
 ERROR: Command errored out with exit status 1:
 command: 
  ....

        36 warnings and 8 errors generated.
        error: command 'gcc' failed with exit status 1
        ----------------------------------------
    ERROR: Command errored out with exit status 1:.

When I attempt to import Pygame into my project I get ModuleNotFoundError (as expected).

Thank you in advance for any advice on how to resolve this issue!

If you have pip installed (I think macos comes with it) you can run:
pip install pygame
If you still can't import try
pip3 install pygame

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