记一次pip/pip3安装uwsgi报错
背景
本来是想着在centos 7.9的主机上面部署一个flask应用,采用的方式是linux+nginx+uwsgi来进行发布,其他的都没有问题,但是在使用pip安装uwsgi时报错了,安装不成功,查了很多方法:试过把pip更新、安装python3-devel等等,但都是不行,最后还是得靠自己,研究了下pip安装方式,发现安装uwsgi是编译安装的,最后一查询发现gcc-c++没有装,安装之后再去安装uwsgi发现就成功。
问题描述
下面是我安装的时候的报错:
[root@* ~]# sudo pip3 install uwsgi
WARNING: Running pip install with root privileges is generally not a good idea. Try pip3 install --user instead.
Collecting uwsgi
Using cached https://files.pythonhosted.org/packages/b3/8e/b4fb9f793745afd6afcc0d2443d5626132e5d3540de98f28a8b8f5c753f9/uwsgi-2.0.21.tar.gz
Installing collected packages: uwsgi
Running setup.py install for uwsgi ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8796okps/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-2_lro4bs-record/install-record.txt --single-version-externally-managed --compile:
/usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'descriptions'
warnings.warn(msg)
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Traceback (most recent call last):
File "/tmp/pip-build-8796okps/uwsgi/uwsgiconfig.py", line 750, in init
gcc_version_components = gcc_version.split('.')
AttributeError: 'NoneType' object has no attribute 'split'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-8796okps/uwsgi/setup.py", line 143, in <module>
'Programming Language :: Python :: 3.11',
File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-8796okps/uwsgi/setup.py", line 77, in run
conf = uc.uConf(get_profile())
File "/tmp/pip-build-8796okps/uwsgi/uwsgiconfig.py", line 758, in __init__
raise Exception("you need a C compiler to build uWSGI")
Exception: you need a C compiler to build uWSGI
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-8796okps/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-2_lro4bs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8796okps/uwsgi/
解决方案
[root@* ~]# yum -y install python3-devel
[root@* ~]# yum -y installl gcc-c++
安装好之后再pip安装uwsgi就没问题了。
记一次pip/pip3安装uwsgi报错的更多相关文章
- 安装 uwsgi报错解决
背景: 安装 uwsgi时报错如下,查阅相关资料说是 python-devel的问题,于是安装之后python-devel后问题解决 报错如下: (venv) [xxxxxxx]# pip insta ...
- Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法
具体报错信息: lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4. ...
- linux安装uwsgi,报错问题解决
uwsgi安装 uwsgi启动后出 -- unavailable modifier requested: 0 出现问题的的原因是找不到python的解释器(其他语言同理) 你使用的yum instal ...
- Centos pip 安装uwsgi 报错“fatal error: Python.h: No such file or directory”
解决方法: 安装python-devel即可,注意,不是python-dev yum -y install python-devel
- centos7安装uwsgi报错
错误为: [root@bogon ~]# pip install uwsgi Collecting uwsgi Using cached uwsgi-.tar.gz Installing collec ...
- Deepin下python安装uwsgi报错: Python.h:没有那个文件或目录
解决方法是安装python-dev,这是Python的头文件和静态库包 正在读取软件包列表... 完成正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包是自动 ...
- mac下安装mysqlcient 报错
一.我在mac下pip3安装mysqlclient 报错: pip3 install mysqlclient Collecting mysqlclient Using cached mysqlclie ...
- 记一次用pip安装docker-compose报错及解决方法
Docker-Compose 的安装 方法一 # 下载1.25.0 docker compose sudo curl -L "https://github.com/docker/compos ...
- python︱模块加载(pip安装)以及pycharm安装与报错解决方式
每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- 准备放下R开始学python,真是痛苦,因为找 ...
- pip安装pycrypto报错:Microsoft Visual C++ 14.0 is required. 和 SSLError: HTTPSConnectionPool的解决办法
今天本打算把[Python3爬虫]网易云音乐爬虫 的代码敲一遍, 但是在安装pycrypto老是报错, 由于我计算是win10, 并且也有vs2017 python3环境下安装pycrypto的一些问 ...
随机推荐
- baselines算法库的安装——Ubuntu20.04系统使用anaconda环境配置
baselines算法库不做过多介绍,个人认为这是公开是所有reinforcement learning算法库中最权威的,虽然没有后期更新,也就是没有了学术界的state of the art , ...
- go语言学习 “go.mod file not found”
遇到问题:安装go 的win安装包后 执行第一个代码: package main import "fmt" func main() { fmt.Println("Hell ...
- Linux统计文件目录下文件的数目命令
Linux下有三个命令:ls.grep.wc.通过这三个命令的组合可以统计目录下文件及文件夹的个数. 1.ls -l | grep "^-" | wc -l:统计当前目录下文件的个 ...
- 【全】CSS动画大全之404页面【a】
效果预览 代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> < ...
- 2023 年上海市大学生程序设计竞赛 - 五月赛A,B,C
A. 选择 多造几组数据可以发现 \(dp[n] = dp[n / 2] + 1\). 假如一个序列为\(\{1,2,\cdots,n\}\),那我们从\(n/2\)后都减去\(n/2\),序列就 ...
- Xinference实战指南:全面解析LLM大模型部署流程,携手Dify打造高效AI应用实践案例,加速AI项目落地进程
Xinference实战指南:全面解析LLM大模型部署流程,携手Dify打造高效AI应用实践案例,加速AI项目落地进程 Xorbits Inference (Xinference) 是一个开源平台,用 ...
- Java String 去掉特殊字符之前的内容方法
为了去除字符串中某个特殊字符之前(包括该特殊字符本身)的所有内容,我们可以使用Java中的String类的substring和indexOf方法.这里,我将给出一个完整的代码示例,该示例会找到字符串中 ...
- 【音视频通话】使用asp.net core 8+vue3 实现高效音视频通话
引言 在三年前,写智能小车的时候,当时小车上有一个摄像头需要采集,实现推拉流的操作,技术选型当时第一版用的是nginx的rtmp的推拉流,服务器的配置环境是centos,2H4G3M的一个配置,ngi ...
- Standard Quorum Intersection
标准定足数交集 定义和背景 系统模型: 系统中有 \(n\) 个节点,其中最多 \(f\) 个节点可能是拜占庭故障节点(恶意节点). 为了保证容忍 \(f\) 个拜占庭节点,系统通常需要至少 \(3f ...
- 以MySQL为例,来看看maven-shade-plugin如何解决多版本驱动共存的问题?
开心一刻 清明节那天,看到一小孩在路边烧纸时不时地偷偷往火堆里扔几张考试卷子边烧边念叨:爷爷呀,你岁数大了,在那边多做做题吧,对脑子好,要是有不懂的地方,就把我老师带走,让他教您! 前提说明 假设 M ...