Pygame - smpeg找不到Python头文件

时间:2014-05-18 03:48:58

标签: python pygame

我一直试图安装Pygame几天,唯一缺少的依赖是smpeg。我得到以下输出:

brew install --HEAD smpeg
==> Installing dependencies for smpeg: gobject-introspection, gdk-pixbuf,
==> Installing smpeg dependency: gobject-introspection
==> Building source; bottle blocked by python requirement
==> Downloading http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.4
Already downloaded: /Library/Caches/Homebrew/gobject-introspection-1.40.0.tar.xz
==> ./configure --prefix=/usr/local/Cellar/gobject-introspection/1.40.0
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/sitepackages
checking for headers required to compile python extensions... ./configure: line 14647:      /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/pytho    n-config: No such file or directory
not found
configure: error: Python headers not found

我还尝试brew edit smpeg,在代码末尾的include.install Dir["*.h"]上方添加end,但无济于事。

我的brew doctor说:

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

我的brew list说:

autoconf    git     libgcrypt   mpfr        sdl_mixer
automake    glib        libgpg-error    pkg-config  sdl_ttf
cloog        gmp        libmpc      portmidi    tree
cmake         gnu-getopt    libpng      pwgen       webp
freetype    isl     libtiff     sdl     xz
gettext     jpeg        libtool     sdl_gfx
gfortran    libffi      mercurial   sdl_image

brew --config

==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 7448fd1532ae1c1709fe2f03ffe0dc188a134b3e
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
X11: 2.7.5 => /opt/X11

brewupdatedupgraded

我有Python 2.7.6

稍后我设法在smpeg.h安装MPEGfilter.h(和Python.framework/Versions/2.7/include/python),现在当我从python setup.py install运行cd pygame-1.9.1release时,我得到了:

/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/movie.c -o build/temp.macosx-10.3-fat-2.7/src/movie.o
In file included from src/movie.c:26:
In file included from src/pygame.h:106:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_main.h:26:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_stdinc.h:30:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config.h:34:
In file included from /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL_config_macosx.h:29:
/usr/include/AvailabilityMacros.h:110:14: warning: Building for Intel with Mac
      OS X Deployment Target < 10.4 is invalid. [-W#warnings]
            #warning Building for Intel with Mac OS X Deployment Target ...
             ^
1 warning generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat-2.7/src/movie.o -ls -lm -lp -le -lg -o build/lib.macosx-10.3-fat-2.7/pygame/movie.so -framework SDL -F/Library/Frameworks/
ld: library not found for -ls
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1

1 个答案:

答案 0 :(得分:0)

得到了它。这样做:在'pygame-1.9.1release','cd src, emacs scale_mmx64.c'内。在那里,我查找了所有出现的“movsxl”并用“movslq”替换了它们(两个)。然后'sudo pip install hg+http://bitbucket.org/pygame/pygame工作'。