Error: LTO wrapper failed collect2: error: LD returned 1 exit status

run the command

pip install uwsgi

error:

a big red error warning, the main error is:

error: lto – wrapper failed

collect2: error: ld returned 1 exit status

after the reason is that GCC version is high

#查看当前系统安装所有版本的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的软连接

run PIP install uwsgi again successfully

reference:

https://blog.csdn.net/weixin_33127753/article/details/84874147

Read More: