我已经在Mac上使用pip成功地在python2中安装了pygame。但是我无法在python3中安装pygame。
输入以下命令后:
$ brew install hg sol sdl_image sdl_ttf
$ brew install sdl_mixer portmidi
$ pip3 install --user hg_http://bitbucket.org/pygame/pygame
我得到了:
Failed building wheel for pygame
Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
Running setup.py install for pygame ... error
和:
36 warnings and 8 errors generated.
error: command 'clang' failed with exit status 1
我已经确保安装了轮子和最新版本的setuptools。我再次尝试使用以下命令:
$ pip3 install pygame
我还是得到了:
Failed building wheel for pygame
Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
Running setup.py install for pygame ... error
我尝试过的其他语法:
$ pip3 install Pygame==1.9.3
$ python3 -m pip install pygame
但它们都产生了相同的错误。
那么,如何在python3中成功安装pygame呢?
发布于 2018-07-18 08:18:46
您需要使用pip,只需输入
python3 -m pip install pygame
这里有一个可能会有帮助的链接
http://medium.com/@louiscouture/tl-dr-pip-bcddaca44540你基本上使用了错误的语法。
https://stackoverflow.com/questions/51391690
复制相似问题