linux anaconda pip uwsgi失敗報錯

linux-gnu/libpython3.6m.a -lutil -lcrypt
    lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4.2
    compilation terminated.
    lto-wrapper: fatal error: gcc returned 1 exit status
    compilation terminated.
    /home/hayley/anaconda3/envs/envUntitled/compiler_compat/ld: error: lto-wrapper failed
    collect2: error: ld returned 1 exit status
    *** error linking uWSGI ***

  • 原因:

當前linux系統gcc版本太高(我的是gcc 7.4,嘗試過gcc 5.5也報了同樣的錯)

  • 解決方案:

安裝低版本gcc

#查看當前系統安裝所有版本的gcc
ls /usr/bin/gcc* -l 
#如果gcc有5以下的版本,則不用在安裝
sudo apt-get  install gcc-4.8
#更改gcc系統默認版本
sudo rm /usr/bin/gcc #刪除已有軟連接
sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc #創建指向gcc4.8的軟連接
  • 參考:

1.Ubuntu16.04上使用Anaconda3的Python3.6的pip安裝UWSGI報錯解決辦法
https://www.cnblogs.com/liuzhen1995/p/8893962.html
2.ubuntu修改gcc版本
https://blog.csdn.net/jacke121/article/details/54565281

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