Pygame安装问题

Posted Tensor

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pygame安装问题相关的知识,希望对你有一定的参考价值。

1.首先使用如下命令:

conda install -c https://conda.anaconda.org/quasiben pygame

测试报错:

>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/matrix/anaconda3/envs/py2/lib/python2.7/site-packages/pygame/__init__.py", line 127, in <module>
    from pygame.base import *
ImportError: dlopen(/Users/matrix/anaconda3/envs/py2/lib/python2.7/site-packages/pygame/base.so, 2): Library not loaded: /usr/local/lib/libSDL-1.2.0.dylib
  Referenced from: /Users/matrix/anaconda3/envs/py2/lib/python2.7/site-packages/pygame/base.so
  Reason: image not found

Solution:

1.卸载:

conda uninstall  pygame

2.重新用pip安装:

python -m pip install pygame

 

以上是关于Pygame安装问题的主要内容,如果未能解决你的问题,请参考以下文章

如何在pycharm里面安装pygame

python中的pygame安装不成功

Pygame安装方法(Windows10, Python-3.7.2)

pygame入门

pygame使用pip安装时报错,求解决

如何在Windows系统安装pygame