Kivy: 在 Windows 上的当前主机中编译 svg.pyx 时出错

创建于 2017-06-20  ·  4评论  ·  资料来源: kivy/kivy

版本

  • 蟒蛇:2.7.13
  • 操作系统:Windows 10
  • Kivy:现任大师
  • Kivy安装方法:从源码安装,mingw

描述

尝试为我从源代码编译 kivy 会导致以下错误:

cythoning .\kivy\graphics/svg.pyx to .\kivy\graphics\svg.c

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
                 end = time()
                 Logger.debug("Svg: Loaded {} in {:.2f}s".format(filename, end - start))
             finally:
                 fd.close()

     cdef void reload(self) except *:
         ^
 ------------------------------------------------------------

 kivy\graphics\svg.pyx:469:9: 'reload' already defined
building 'kivy.graphics.svg' extension
C:\Python27\Scripts\gcc.exe -mdll -O -Wall -I.\kivy\include -IC:\Python27\include -I.\kivy\include -IC:\Python27\include -IC:\Python27\PC -c .\kivy\graphics\svg.c -o build\temp.win-amd64-2.7\Release\.\kivy\graphics\svg.o
.\kivy\graphics\svg.c:1:2: error: #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.
  ^
 error: command 'C:\\Python27\\Scripts\\gcc.exe' failed with exit status 1

我怀疑这与此提交有关: https :

最有用的评论

谢谢大家,它可以用 Cython 0.25 正确编译! 我使用的是 Cython 0.24。 在安装指南中可能值得一提的是,我们现在对 Cython 0.25 有一个硬依赖——安装页面以粗体列出了 Cython 0.23: https ://kivy.org/docs/installation/installation.html

所有4条评论

你能指出你的 Cython 版本吗?

更改与您的环境一起编译,我们在那里使用 Cython 0.25.2 。 可能是您有一个旧的 Cython,而此更改可能仅在 X 版本中存在。

编辑:虽然,MinGW 和 MinGWPy 有点不同,但我认为这也可能是什么? 尝试安装后者:

pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy

谢谢大家,它可以用 Cython 0.25 正确编译! 我使用的是 Cython 0.24。 在安装指南中可能值得一提的是,我们现在对 Cython 0.25 有一个硬依赖——安装页面以粗体列出了 Cython 0.23: https ://kivy.org/docs/installation/installation.html

@sbrother谢谢。 你拯救了我的一天。

此页面是否有帮助?
0 / 5 - 0 等级