背景

本来是想着在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报错的更多相关文章

  1. 安装 uwsgi报错解决

    背景: 安装 uwsgi时报错如下,查阅相关资料说是 python-devel的问题,于是安装之后python-devel后问题解决 报错如下: (venv) [xxxxxxx]# pip insta ...

  2. Ubuntu16.04上使用Anaconda3的Python3.6的pip安装UWSGI报错解决办法

    具体报错信息: lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4. ...

  3. linux安装uwsgi,报错问题解决

    uwsgi安装 uwsgi启动后出 -- unavailable modifier requested: 0 出现问题的的原因是找不到python的解释器(其他语言同理) 你使用的yum instal ...

  4. Centos pip 安装uwsgi 报错“fatal error: Python.h: No such file or directory”

    解决方法: 安装python-devel即可,注意,不是python-dev yum -y install python-devel

  5. centos7安装uwsgi报错

    错误为: [root@bogon ~]# pip install uwsgi Collecting uwsgi Using cached uwsgi-.tar.gz Installing collec ...

  6. Deepin下python安装uwsgi报错: Python.h:没有那个文件或目录

    解决方法是安装python-dev,这是Python的头文件和静态库包 正在读取软件包列表... 完成正在分析软件包的依赖关系树       正在读取状态信息... 完成       下列软件包是自动 ...

  7. mac下安装mysqlcient 报错

    一.我在mac下pip3安装mysqlclient 报错: pip3 install mysqlclient Collecting mysqlclient Using cached mysqlclie ...

  8. 记一次用pip安装docker-compose报错及解决方法

    Docker-Compose 的安装 方法一 # 下载1.25.0 docker compose sudo curl -L "https://github.com/docker/compos ...

  9. python︱模块加载(pip安装)以及pycharm安装与报错解决方式

    每每以为攀得众山小,可.每每又切实来到起点,大牛们,缓缓脚步来俺笔记葩分享一下吧,please~ --------------------------- 准备放下R开始学python,真是痛苦,因为找 ...

  10. pip安装pycrypto报错:Microsoft Visual C++ 14.0 is required. 和 SSLError: HTTPSConnectionPool的解决办法

    今天本打算把[Python3爬虫]网易云音乐爬虫 的代码敲一遍, 但是在安装pycrypto老是报错, 由于我计算是win10, 并且也有vs2017 python3环境下安装pycrypto的一些问 ...

随机推荐

  1. aarch64/arm_v8 环境下编译Arcade-Learning-Environment —— ale-py —— gym[atari]的安装

    aarch64架构下不支持gym[atari]安装,因此我们只能在该环境下安装gym,对于atari环境的支持则需要源码上重新编译,也就是本文给出的下面的方法: 源码下载: https://githu ...

  2. python版本的两款NVIDIA显卡管理查询工具

    本文所述如题; 给出两个python版本的NVIDIA显卡管理查询工具 1.  py3nvml github下载地址: https://github.com/fbcotter/py3nvml Requ ...

  3. 高效调度新篇章:详解DolphinScheduler 3.2.0生产级集群搭建

    转载自tuoluzhe8521 导读:通过简化复杂的任务依赖关系, DolphinScheduler为数据工程师提供了强大的工作流程管理和调度能力.在3.2.0版本中,DolphinScheduler ...

  4. 《最新出炉》系列小成篇-Python+Playwright自动化测试-66 - 等待元素至指定状态(出现、移除、显示和隐藏)

    1.简介 在我们日常工作中进行UI自动化测试时,保证测试的稳定性至关重要.其中一个关键方面是正确地定位和操作网页中的元素.在网页中,元素可能处于不同的状态,有些可能在页面加载完成之前不在DOM中,需要 ...

  5. 利用XtraBackup对MGR集群进行扩容

    运行了一段时间以后MGR集群,需要扩容节点,这是一个常见的需求.很多时候我们都喜欢用mysqldump工具来进行,因为这个工具有一个很好用的参数叫做master-data以及single-transa ...

  6. WIN32下的模拟时钟

    #include <Windows.h> #include <math.h> #include <tchar.h> #include "resource. ...

  7. 基于gitee+hexo搭建个人博客

    gitee准备 注册好gitee git安装与配置 下载git默认安装,配置 在之前下载的目录下,右键,选择[Git Bash Here] 配置用户 git config --global user. ...

  8. CANopen学习笔记(一)CANopen入门

    CANOpen入门 定位:小网络,控制信号的实时通讯 ​ 确保实时性采取的措施 ID域:11bit(CAN标准帧格式) 控制报文采用数据最小字节数 采用生产消费模型(数据无需应答) 需要应答时,采用快 ...

  9. LaTeX 编译警告:Script 'CJK' not explicitly supported within font 'FandolSong-Regular'. Check the typeset output, and if it is okay then ignore this warning. Otherwise a different font should be chosen.

    在编译一篇中文文档时遇到如下警告: Package fontspec Warning: Script 'CJK' not explicitly supported within font 'Fando ...

  10. maven 插件之 maven-shade-plugin,解决同包同名 class 共存问题的神器

    开心一刻 有一天螃蟹出门,不小心撞倒了泥鳅泥鳅很生气地说:你是不是瞎啊!螃蟹说:不是啊,我是螃蟹 概述 maven-shade-plugin 官网已经介绍的很详细了,我给大家简单翻译一下 This p ...