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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM