CentOS Cython編譯

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

參考:
https://www.cnblogs.com/xiyushimei/p/8550930.html
https://www.cnblogs.com/jixiaohua/p/11732225.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章