这可能是一个新手问题.我无法cython化一个简单的helloworld.pyx教程脚本,而完全相同的代码适用于linux:
print("hello world")
Run Code Online (Sandbox Code Playgroud)
这是setup.py脚本:
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize('helloworld.pyx'))
Run Code Online (Sandbox Code Playgroud)
但我跑完后得到了这个python setup.py build_ext --inplace:
running build_ext
building 'helloworld' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/haotian/anaconda3/include -arch x86_64 -I/Users/haotian/anaconda3/include -arch x86_64 -I/Users/haotian/anaconda3/include/python3.6m -c helloworld.c -o build/temp.macosx-10.7-x86_64-3.6/helloworld.o
In file included from helloworld.c:16:
In file included from /Users/haotian/anaconda3/include/python3.6m/Python.h:34:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:196:2: error: unknown type name 'uint8_t'
uint8_t ri_uuid[16];
^ …Run Code Online (Sandbox Code Playgroud)