简体   繁体   English

安装pygame mac,python 2.7.9,freetype和其他依赖项问题

[英]Installing pygame mac, python 2.7.9, issues with freetype and other dependencies

I'm trying to install pygame on Mac, and I've been able to install the dependencies, however I'm stuck at this step 我正在尝试在Mac上安装pygame,并且已经能够安装依赖项,但是在此步骤中我被困住了

pip install hg+http://bitbucket.org/pygame/pygame

The installation fails at the certain point: 安装在某些时候失败:

fatal error: 'freetype/config/ftheader.h' file not found

#include <freetype/config/ftheader.h>

How do I fix this, I'm pretty sure I have freetype (see below)? 我要如何解决这个问题,我很确定自己具有freetype(请参见下文)?

I also noticed that even though I installed all the dependencies, I get notifications like these when compiling. 我还注意到,即使我安装了所有依赖项,在编译时也会收到类似的通知。

SDL     : found 1.2.15
Framework SDL not found
FONT    : found
Framework SDL_ttf not found
IMAGE   : found
Framework SDL_image not found
MIXER   : found
Framework SDL_mixer not found
SMPEG   : found 0.4.5
Framework smpeg not found
Framework CoreMIDI found
Framework QuickTime found
PNG     : found
JPEG    : found
PORTMIDI: found
FREETYPE: found 2.5.3
AVFORMAT: not found
SWSCALE : not found

I ran into a similar problem and the following worked for me: 我遇到了类似的问题,以下对我有用:

First, find the location of your systems freetype include files with 首先,找到您的系统freetype包含文件的位置

freetype-config --cflags

For me, the first result looked like: 对我来说,第一个结果看起来像:

-I/Users/username/anaconda/include/freetype2

Now rerun the pip install but with the environment variable CFLAGS set to result of the previous step. 现在,重新运行pip install但将环境变量CFLAGS设置为上一步的结果。 Again, for me, this looked like: 同样,对我来说,这看起来像:

CFLAGS='-I/Users/username/anaconda/include/freetype2 pip install hg+http://bitbucket.org/pygame/pygame

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM