python运行报警告:Cython directive 'language_level' not set, using '3str' for now (Py3)
相关:
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"
),
)
不再报警告。
本博客是博主个人学习时的一些记录,不保证是为原创,个别文章加入了转载的源地址,还有个别文章是汇总网上多份资料所成,在这之中也必有疏漏未加标注处,如有侵权请与博主联系。
如果未特殊标注则为原创,遵循 CC 4.0 BY-SA 版权协议。
posted on 2024-07-25 18:37 Angry_Panda 阅读(430) 评论(0) 收藏 举报
浙公网安备 33010602011771号