[英]Cython compilation error with include_path as a keyword in cythonize
我有一個名為'test.pyx'的代碼段:
import numpy as np
cimport numpy as np
print(np.arange(10))
然后我寫了兩個setup.py
來編譯它們。 第一個工作正常:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy as np
extensions = [
Extension('test', ['test.pyx'], include_dirs = [np.get_include()]),
]
setup(
ext_modules = cythonize(extensions)
)
而這個不起作用(這也來自http://docs.cython.org/src/reference/compilation.html上的一個例子):
from distutils.core import setup
from Cython.Build import cythonize
import numpy as np
setup(
ext_modules = cythonize('./test.pyx', include_path=[np.get_include()])
)
它說:./ test.c(346):致命錯誤C1083:無法打開包含文件:'numpy / arrayobject.h':沒有這樣的文件或目錄。
我在Windows 64位上使用Python 3.3 64位,使用WinSDK 7.1。
這是一個Cython文檔錯誤,另請參閱https://github.com/cython/cython/issues/1480
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.