我想知道为什么Pygame 1.9.2 for Python 3.4的安装无效(http://pygame.org/wiki/macintosh处的程序)。 当我尝试运行pip命令来安装pygame时(最后一步),出现以下错误:
# pip3 install hg+http://bitbucket.org/pygame/pygame
# doing the installation stuff successfully for the first part
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -D_THREAD_SAFE -DENABLE_NEWBUF=1 -I/usr/X11R6/include -I/usr/local/include/SDL -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c src/cdrom.c -o build/temp.macosx-10.11-x86_64-3.5/src/cdrom.o
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.11-x86_64-3.5/src/cdrom.o -L/usr/local/lib -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lSDLmain -lSDL -o build/lib.macosx-10.11-x86_64-3.5/pygame/cdrom.cpython-35m-darwin.so -Wl,-framework,Cocoa
building 'pygame.color' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ddarwin -D_THREAD_SAFE -DENABLE_NEWBUF=1 -I/usr/X11R6/include -I/usr/local/include/SDL -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c src/color.c -o build/temp.macosx-10.11-x86_64-3.5/src/color.o
src/color.c:316:5: error: use of undeclared identifier 'Py_TPFLAGS_CHECKTYPES'
COLOR_TPFLAGS,
^
src/color.c:276:23: note: expanded from macro 'COLOR_TPFLAGS'
#define COLOR_TPFLAGS COLOR_TPFLAGS_COMMON
^
src/color.c:272:49: note: expanded from macro 'COLOR_TPFLAGS_COMMON'
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_CHECKTYPES)
^
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python3/bin/python3.5 -c "import setuptools, tokenize;__file__='/var/folders/yj/c9jf0d390yn3lnqrpz8489fr0000gn/T/pip-s2tg3zc8-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/yj/c9jf0d390yn3lnqrpz8489fr0000gn/T/pip-we1hfsvl-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /var/folders/yj/c9jf0d390yn3lnqrpz8489fr0000gn/T/pip-s2tg3zc8-build
感谢任何帮助!
答案 0 :(得分:1)
我刚才遇到了同样的错误。我在最后一次修订之前指出了提交,以使其现在正常工作。
pip install hg+http://bitbucket.org/pygame/pygame/@96203be