网站首页 Python Mac安装Pygame遇到的坑
Mac安装Pygame遇到的坑
编辑时间:2018-12-12 17:17:20 作者:admin 浏览量:1959

1、通过brew安装依赖包

brew install sdl smpeg sdl_image sdl_mixer sdl_ttf portmidi hg sdl_mixer portmidi

安装报错

Error: The following formula

  [#<Dependency: "python@2" []>, #<Options: []>]

cannot be installed as binary package and must be built from source.

Install the Command Line Tools:

  xcode-select --install

解决方法:

xcode-select --install  


安装报错

Error: An unexpected error occurred during the `brew link` step 

2.png

解决办法

1):尝试创建Frameworks文件夹

sudo mkdir /usr/local/Frameworks

2):更改目录权限

sudo chown -R $(whoami) /usr/local/Frameworks


2、安装XQuartz

3.png

3、通过pip3安装Pygame

pip3 install --user hg+http://bitbucket.org/pygame/pygame

D95AD3B9-808C-4434-B86F-E2F9CE0E3767.png

4、python3 -m pygame.examples.aliens

4.png



    上一篇:Python - Sublime Text 3 控制台不能输出中文的解决方法
    下一篇:laravel自定义分页样式
    出自:洪庆柳

    地址:www.xmaniu.com

    转载请注明出处!