栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

Ubuntu18.04安装uwsgi时出现的错误
(py3.8.5) 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('"'"'rn'"'"', '"'"'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).
可能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.

解决方法

把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.解决
(py3.8.5) 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

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/831009.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号