fatal error: bytecode stream generated with LTO version x.0 instead of the expected x.x

/lib/python3.6/config-3.6m-x86_64-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/spring/anaconda3/compiler_compat/ld: error: lto-wrapper failed
    collect2: error: ld returned 1 exit status
    *** error linking uWSGI ***
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/spring/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e45wke5t/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e45wke5t/uwsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-h5z3m81a/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

在ubuntu18下安装simple-tensorflow-serving失败
具体是在安装uwsgi时失败

解决方法
把GCC的版本改成需要的版本,安装4.8试试。
1、安装
sudo apt-get install gcc-4.8
2、查看当前版本
ls /usr/bin/gcc*
3、设置4.8为优先使用版本
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
4、重新安装uwsgi
pip install uwsgi
或者pip install simple-tensorflow-serving

你可能感兴趣的:(fatal error: bytecode stream generated with LTO version x.0 instead of the expected x.x)