简体   繁体   English

Kivy Python 3.4 osX安装失败

[英]Kivy Python 3.4 osX installation failure

I get this error when trying to install kivy. 尝试安装kivy时出现此错误。 I used the command "pip install kivy". 我使用了命令“ pip install kivy”。 I have already installed pygame and cython 我已经安装了pygame和cython

5 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -g build/temp.macosx-10.6-intel-3.4/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/vertex_instructions.o -o build/lib.macosx-10.6-intel-3.4/kivy/graphics/vertex_instructions.so -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks -framework OpenGL -arch x86_64 -lm
cythoning /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.pyx to /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c
building 'kivy.graphics.context' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c -o build/temp.macosx-10.6-intel-3.4/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks -arch x86_64
/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
 ^
1 error generated.

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
     cpdef release(self)
     cpdef get_pixel_color(self, int wx, int wy)

     cdef void create_fbo(self)
     cdef void delete_fbo(self)
     cdef void apply(self)
                   ^
 ------------------------------------------------------------

 kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
     cdef void push_states(self, list names) except *
     cdef void pop_state(self, str name) except *
     cdef void pop_states(self, list names) except *
     cdef void enter(self) except *
     cdef void leave(self) except *
     cdef void apply(self) except *
                   ^
 ------------------------------------------------------------

 kivy/graphics/instructions.pxd:123:19: Previous declaration is here
 error: command '/usr/bin/clang' failed with exit status 1

----------------------------------------

Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize; 命令“ /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c”导入设置工具,标记化; file ='/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/setup.py';exec(compile(getattr(tokenize, 'open', open)( file ).read().replace('\\r\\n', '\\n'), file , 'exec'))" install --record /var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-8w_np22h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy 文件 ='/ private / var / folders / nd / ylp3_pwd58g73gh8vggtrc8r0000gn / T / pip-build-hcskmfya / kivy / setup.py'; exec(compile(getattr(tokenize,'open',open)( file ).read() .replace('\\ r \\ n','\\ n'), file ,'exec'))“安装--record /var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-8w_np22h-record/install-record.txt --single-version-externally-managed --compile“在/ private / var / folders / nd / ylp3_pwd58g73gh8vggtrc8r0000gn / T / pip-build-hcskmfya / kivy中失败,错误代码为1

This arises from a change in cython a while ago. 这是由于前段Cython的变化引起的。 You can avoid it by either installing kivy from the github master branch rather than pypi (there is a pip syntax for this), or by downgrading cython, possibly to 0.21. 您可以通过从github master分支而不是pypi安装kivy(有pip语法)或将cython降级到0.21来避免这种情况。

Python 2.7 MacOS 10.12 Python 2.7 MacOS 10.12

I was trying to install Kivy on my mac(sierra), it took me quite sometime to figure it out. 我试图在Mac(Sierra)上安装Kivy,花了相当长的时间才弄清楚。 Give this a shot. 试一下。

Install Cython with downgraded version 使用降级版本安装Cython

pip install 'Cython===0.26.1'

From the documentation it asked you to install Cython, by 从要求您安装Cython的文档中,

pip install -U Cython

but it couldn't compile when installing Kivy, and I found in Kivy's git repo, it didn't use the latest version of Cython, instead if uses version 0.26.1 但是在安装Kivy时无法编译,而且我在Kivy的git repo中发现,它没有使用最新版本的Cython,而是使用0.26.1版

Installing Kiwy by 通过安装Kiwy

pip install --user kivy

Without the --user flag it will throw an error saying 如果没有--user标志,它将抛出错误提示

“OSError: [Errno 1] Operation not permitted”

Good Luck. 祝好运。

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

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