Linux Ubuntu16.04安装uwsgi时出现 ERROR: Command errored out with exit status 1:

目录

问题描述

原因

解决方法

1.查看GCC,G++的版本的版本

2.重新安装低版本

3.查看当前版本

4.设置4.8为优先使用版本

5.重新安装uwsgi

6.解决


问题描述

Ubuntu16.04安装uwsgi时出现的错误。

(py36) root@ecs-7dec:/usr/local/web/django/oldMan# pip3 install uwsgi -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting uwsgi
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/24/fd/93851e4a076719199868d4c918cc93a52742e68370188c1c570a6e42a54f/uwsgi-2.0.20.tar.gz (804 kB)
Collecting some-package
  Using cached some_package-0.1-py3-none-any.whl
Building wheels for collected packages: uwsgi
  Building wheel for uwsgi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/anaconda3/envs/py36/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-b1z3zd63/uwsgi_7dd4eaa5c088463caa5814adbdff140a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-b1z3zd63/uwsgi_7dd4eaa5c088463caa5814adbdff140a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-bxv37xjh
       cwd: /tmp/pip-install-b1z3zd63/uwsgi_7dd4eaa5c088463caa5814adbdff140a/

原因

官方文档上说
To build uWSGI you need Python and a C compiler (gcc and clang are supported).
系统已经安装了Python 3.6, 可能gcc的版本不对, 但是上面错误说是LTO的版本不对。

This error basically means that you’ve got some binary build results (mostly object files) which are incompatible with other binary build results, but you’re trying to link them together.
ubuntu16.04的版本太高了。





解决方法

把GCC的版本改成需要的版本,安装4.8试试。

1.查看GCC,G++的版本的版本
 

gcc -v
g++ -v

2.重新安装低版本
 

sudo apt-get install gcc-4.8

3.查看当前版本

ls /usr/bin/gcc*


4.设置4.8为优先使用版本

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100


5.重新安装uwsgi
 

pip install uwsgi

6.解决

(py36) root@ecs-7dec:/usr/local/web/django/oldMan# pip install uwsgi
Collecting uwsgi
  Using cached uwsgi-2.0.20.tar.gz (804 kB)
Building wheels for collected packages: uwsgi
  Building wheel for uwsgi (setup.py) ... done
  Created wheel for uwsgi: filename=uWSGI-2.0.20-cp36-cp36m-linux_x86_64.whl size=1929621 sha256=1db4d9f8ea468f7e129699356c85a00b9625338bc25d26cfad7c7d7bc0b3dee7
  Stored in directory: /root/.cache/pip/wheels/4a/60/83/bd5b22ba1a9298cc00c9f6400101b3757d958e10b1b38348f8
Successfully built uwsgi
Installing collected packages: uwsgi
Successfully installed uwsgi-2.0.20
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

superboy@.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值