Ubuntu16.04上使用Anaconda3的Python3.6的pip安裝UWSGI報錯解決辦法


具體報錯信息:


lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4.1

    compilation terminated.

    lto-wrapper: fatal error: gcc returned 1 exit status

    compilation terminated.

    /home/liuzhen/anaconda3/compiler_compat/ld: error: lto-wrapper failed

    collect2: error: ld returned 1 exit status

    *** error linking uWSGI ***

    


解決辦法:


原因是Ubuntu系統的gcc版本問題,我安裝時本機的gcc版本是5.4,然后我把gcc版本修改成了4.7,重新使用pip install uwsgi,完美解決問題。

安裝gcc4.7:sudo apt-get  install gcc-4.7

修改系統默認的gcc版本:https://blog.csdn.net/jacke121/article/details/54565281

步驟:
sudo rm /usr/bin/gcc(刪除已有軟連接)

sudo ln -s /usr/bin/gcc-4.7 /usr/bin/gcc(創建指向gcc4.7的軟連接,這樣系統默認的gcc版本就是4.7了)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM