相关:
https://stackoverflow.com/questions/34603628/how-to-specify-python-3-source-in-cythons-setup-py
cython的setup.py文件内容:
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'Great Circle module v1',
ext_modules = cythonize("great_circle_cy_v1.pyx", ),
)
执行cython编译:
python great_circle_setup_v1.py build_ext --inplace
报出警报:( 不影响编译运行 )
修改cython的setup.py编译文件内容:
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'Great Circle module v1',
ext_modules = cythonize("great_circle_cy_v1.pyx",
compiler_directives={'language_level' : "3"}
# or "2" or "3str"
),
)
不再报警告。
标签:Cython,set,directive,python,setup,py,v1,import From: https://www.cnblogs.com/devilmaycry812839668/p/18323909