CentOS Cython编译
  bDQnVrJUSZXY 2023年11月02日 80 0


编译命令:​​python setup.py build_ext --inplace​

CentOS Cython编译报错处理:
使用python3,缺少python依赖包时,执行:
​​​sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple <包名>​

ImportError: No module named Cython.Distutils,执行:
​​​python3 setup.py build_ext --inplace​

unable to execute ‘gcc’: No such file or directory
error: command ‘gcc’ failed with exit status 1,执行:
​​​sudo yum -y install gcc gcc-c++ kernel-devel​

fatal error: Python.h: No such file or directory,执行:
​​​yum search python | grep python-devel​​​​sudo yum install python-devel.x86_64​

升级gcc
​​​sudo yum install centos-release-scl​​​​sudo yum install devtoolset-8-gcc*​​    也可以安装7版本的 devtoolset-7-gcc*
​scl enable devtoolset-8 bash​​       激活对应的devtoolset(本次有效)
​gcc -v​​                 查看版本

未知错误:
可能是使用C++的模块,添加C++编译指令
​​​%%cython -a --cplus​​ CompileError: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe’ failed with exit status 2


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
bDQnVrJUSZXY