Ubuntu 20 安装 uwsgi 失败解决办法

ubuntu20 安装和配置 uWSGI nginx 部署django 先配置2个小地方 一.在项目的settings.py里修改ip地址 DEBUG = False ALLOW_HOSTS=[‘XXXXXX’] #改成阿里云的公网IP 二.mysql 1、进入位置: cd /etc/mysql/mysql.conf.d 2.编辑mysqld.cnf #配置文件路径 vim mysqld.cnf 3.注释掉下面这句 #bind-address= 127.0.0.1 #注释掉这一行 安装和配置uwsgi 1.安装uwsgi pip3 install uwsgi 2.在项目根目录位 阅读详情

环境:Ubuntu 20.04 LTS
Python 版本:python3.8.10
虚拟环境路径:/home/venv

激活虚拟环境后,安装 uswgi

pip install uwsgi

报错如下:

 ERROR: Command errored out with exit status 1:
     command: /home/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3591s32k/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3591s32k/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-5m3qkuq_/install-record.txt --single-version-externally-managed --compile --install-headers /home/venv/include/site/python3.8/uwsgi
         cwd: /tmp/pip-install-3591s32k/uwsgi/
    Complete output (92 lines):
    /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
      warnings.warn(msg)
    running install
    using profile: buildconf/default.ini
    detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/9/include', '/usr/local/include', '/usr/include/x86_64-linux-gnu', '/usr/include']
    Patching "bin_name" to properly install_scripts dir
    detected CPU cores: 2
    configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wformat-signedness -DUWSGI_HAS_IFADDRS -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.26\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="26" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(ugreen);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(ugreen);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
    *** uWSGI compiling server core ***
    core/utils.o is up to date
    core/protocol.o is up to date
    core/socket.o is up to date
    core/logging.o is up to date
    core/master.o is up to date
    core/master_utils.o is up to date
    core/emperor.o is up to date
    core/notify.o is up to date
    core/mule.o is up to date
    core/subscription.o is up to date
    core/stats.o is up to date
    core/sendfile.o is up to date
    core/async.o is up to date
    core/master_checks.o is up to date
    core/fifo.o is up to date
    core/offload.o is up to date
    core/io.o is up to date
    core/static.o is up to date
    core/websockets.o is up to date
    core/spooler.o is up to date
    core/snmp.o is up to date
    core/exceptions.o is up to date
    core/config.o is up to date
    core/setup_utils.o is up to date
    core/clock.o is up to date
    core/init.o is up to date
    core/buffer.o is up to date
    core/reader.o is up to date
    core/writer.o is up to date
    core/alarm.o is up to date
    core/cron.o is up to date
    core/hooks.o is up to date
    core/plugins.o is up to date
    core/lock.o is up to date
    core/cache.o is up to date
    core/daemons.o is up to date
    core/errors.o is up to date
    core/hash.o is up to date
    core/master_events.o is up to date
    core/chunked.o is up to date
    core/queue.o is up to date
    core/event.o is up to date
    core/signal.o is up to date
    core/strings.o is up to date
    core/progress.o is up to date
    core/timebomb.o is up to date
    core/ini.o is up to date
    core/fsmon.o is up to date
    core/mount.o is up to date
    core/metrics.o is up to date
    core/plugins_builder.o is up to date
    core/sharedarea.o is up to date
    core/rpc.o is up to date
    core/gateway.o is up to date
    core/loop.o is up to date
    core/cookie.o is up to date
    core/querystring.o is up to date
    core/rb_timers.o is up to date
    core/transformations.o is up to date
    core/uwsgi.o is up to date
    proto/base.o is up to date
    proto/uwsgi.o is up to date
    proto/http.o is up to date
    proto/fastcgi.o is up to date
    proto/scgi.o is up to date
    proto/puwsgi.o is up to date
    lib/linux_ns.o is up to date
    core/yaml.o is up to date
    [thread 1][x86_64-linux-gnu-gcc -pthread] core/dot_h.o
    [thread 0][x86_64-linux-gnu-gcc -pthread] core/config_py.o
    *** uWSGI compiling embedded plugins ***
    [thread 0][x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o
    [thread 1][x86_64-linux-gnu-gcc -pthread] plugins/python/pyutils.o
    In file included from plugins/python/python_plugin.c:1:
    plugins/python/uwsgi_python.h:4:10: fatal error: Python.h: No such file or directory
        4 | #include <Python.h>
          |          ^~~~~~~~~~
    compilation terminated.
    In file included from plugins/python/pyutils.c:1:
    plugins/python/uwsgi_python.h:4:10: fatal error: Python.h: No such file or directory
        4 | #include <Python.h>
          |          ^~~~~~~~~~
    compilation terminated.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3591s32k/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3591s32k/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-5m3qkuq_/install-record.txt --single-version-externally-managed --compile --install-headers /home/venv/include/site/python3.8/uwsgi Check the logs for full command output.

解决办法:安装对应的 Python 对应版本的编译依赖包即可
,比如我这里是 python3.8,即安装 3.8-dev 如下命令:

apt-get install python3.8-dev

然后直接在虚拟环境里安装 uwsgi 就可以了

pip install uwsgi

或者

pip3.8 install uwsgi

这一切都可以在虚拟环境激活的时候完成,不需要卸载 Python 环境或者重新创建虚拟环境,非常简单

学弟教程-Flask-使用uwsgi部署 文章目录一、实验配置二、实验过程2.1 建立虚拟环境2.2 安装Flask2.3 安装uswgi2.4 使用uwsgi部署Flask 一、实验配置 实验环境 : Ubunttu20.04 Python版本 : Python3.7 二、实验过程 2.1 建立虚拟环境 创建demo文件夹并进入 mkdir demo cd demo 查看Python解释器位置 whereis python 博主此处的位置为/usr/bin/python3.8 建立名为venv的虚拟环境 virtualenv -p /us 阅读详情

相关推荐

Ubuntu下使用Django、Nginx和uWSGI进行部署的详细教程

Django是一个强大的Python Web框架,Nginx是一个流行的高性能Web服务器,而uWSGI是一个用于将Python应用程序与Web服务器连接的工具。恭喜您成功地在Ubuntu上部署了Django应用程序,并通过Nginx和uWSGI进行了配置。恭喜您成功地在Ubuntu上部署了Django应用程序,并通过Nginx和uWSGI进行了配置。在部署Django应用程序之前,我们建议您在Ubuntu上创建一个虚拟环境。现在,您的Django应用程序已经部署并正在通过Nginx和uWSGI提供服务。

qq_37934722的博客 429

记一次pip/pip3安装uwsgi报错

本来是想着在centos 7.9的主机上面部署一个flask应用,采用的方式是linux+nginx+uwsgi来进行发布,其他的都没有问题,但是在使用pip安装uwsgi时报错了,安装不成功,查了很多方法:试过把pip更新、安装python3-devel等等,但都是不行,最后还是得靠自己,研究了下pip安装方式,发现安装uwsgi是编译安装的,最后一查询发现gcc-c++没有装,安装之后再去安装uwsgi发现就成功。

KH_FC的博客 3265

Python&运维系列(亲测有效):ubuntu设置uwsgi和nginx开机自启(在虚拟环境下启动)

ubuntu设置uwsgi和nginx开机自启(在虚拟环境下启动)

weixin_54626591的博客 2502

pip3 install uwsgi 排错

请确保您的系统已安装以下软件包:`gcc`、`python3-dev`(或`python3-devel`)和`openssl-devel`(或`libssl-dev`)。3. 使用`--no-cache-dir`选项:尝试使用`--no-cache-dir`选项重新安装uwsgi,以避免使用缓存文件。6. 使用sudo权限:如果您在系统上具有sudo权限,可以尝试使用sudo来安装uwsgi,以确保具有足够的权限进行安装。请注意,您需要在虚拟环境中安装所有其他项目依赖项,并确保在虚拟环境中运行您的项目。

wenxi2367的博客 2064

告别BAPI!深入SAP S/4HANA BP框架:cl_md_bp_maintain维护客户主数据的正确姿势与性能优化

本文深入解析SAP S/4HANA中cl_md_bp_maintain框架的高效实践与架构设计,对比传统BAPI方式,展示其在业务伙伴(BP)主数据维护中的性能优势与现代化特性。通过详细代码示例和性能测试数据,揭示如何利用该框架实现批量处理、集中校验及智能错误恢复,助力企业从ECC向S/4HANA平滑迁移。

weixin_30596735的博客 361

如何利用DeepSeek自动生成PLC程序?

在工业自动化领域,PLC是核心控制设备,其编程效率和质量直接影响生产线的运行效果。 然而,传统PLC编程依赖工程师手动编写代码,不仅耗时耗力,还容易出错。通过自动生成PLC程序,DeepSeek不仅大幅提升了编程效率,还优化了代码质量。 那么DeepSeek到底能否自动生成PLC程序呢? 有位电气工程师就尝试让DeepSeek设计一套五层电梯控制系统的PLC程序,下面就让我们看看吧。 技术原理:DeepSeek如何实现自动编程DeepSeek利用自然语言处理技术,将工程师输入的文本指令转换为PLC代码。例

Qinmingyue13的博客 6198

ubuntu系统下uWSGI安装和启动的两个坑

小白实践… ubuntu系统下安装uWSGI的坑: 会出现以下问题: lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4.1 compilation terminated. lto-wrapper: fatal error: gcc returned 1 exit s...

weixin_42682982的博客 3469

电力电子课设救星:用Simulink实现Buck变换器双闭环控制(PID调参技巧)

本文是电力电子课程设计的实用指南,详细讲解如何利用Simulink仿真平台实现Buck变换器的电压电流双闭环控制。文章核心聚焦于PID参数整定的实战技巧,提供了从手动调试口诀到MATLAB脚本自动优化的完整方案,旨在帮助学生高效完成课设,深入理解闭环控制原理并生成专业报告。

weixin_29179311的博客 297

Ubuntu16.04下安装Uwsgi失败解决办法

今天安装Uwsgi屡次失败,找了很多办法终于解决了。 报错误: Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-uadvmvn5/uwsgi/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().repla...

qq_39554246的博客 3083

CTF——流量分析题型整理总结

我见过的流量分析类型的题目总结: 一,ping 报文信息 (icmp协议) 二,上传/下载文件(蓝牙obex,http,难:文件的分段上传/下载) 三,sql注入攻击 四,访问特定的加密解密网站(md5,base64) 五,后台扫描+弱密码爆破+菜刀 六,usb流量分析 七,WiFi无线密码破解 八,根据一组流量包了解黑客的具体行为 例题: 一,ping 报文信息 (icm...

小锤队长的博客 5万+

AI学习指南RAG篇(19)-API调用与集成

通过上述API调用示例,您可以方便地将RAGFlow与其他系统集成,实现数据集管理、文档处理、会话管理等功能。希望本文的介绍能帮助您更好地理解和使用RAGFlow的API。

俞兆鹏的博客 2551

Windows 10安装uWSGI:不可行、失败了

Windows 10家庭中文版,Python 3.6.4,uwsgi-2.0.17.tar.gz,压缩工具-7-zip 提示:请不要和我一样尝试,浪费时间,去Linux上玩吧! 几个小时的安装经历 昨天下午学习到将“Django项目部署到Nginx服务器”,此部署除了需要Nginx服务器外,还需要一个和Nginx服务器 进行通信的协议软件——uwsgi。 可是,经过...

aimianwo1708的博客 6186

【2024年华为秋招-12月25日-第三题(300分)- PCB印刷电路板布线】(题目+思路+Java&C++&Python解析+在线测试)

在PCB印刷电路板设计中,器件之间的连线需要避免线路的阻抗值增大、而且赛件之间还有别的器件和别的干扰源,在布线时我们希望受到的干扰尽量小。现将电路板简化成一个M×N的矩阵,每个位置(单元格)的值表示其源干扰度。如果单元格的值为0,表示此位置没有干扰源;如果单元格的值为非0,则表示此位置是干扰源,其值为源干扰度。连线经过干扰源或干扰源附近会增加连线的总干扰度。位置Axy的干扰源的源干扰度为dd01、若连线经过位置Axy,则其总干扰度会增加d;2、若连线经过离位置A。

m0_73659489的博客 349

Ubuntu安装uWSGI失败

在服务器上生成了一个新的python3.5虚拟环境,但是pip install uwsgi总是失败 报错: Command "/root/python/salary/venv_salary/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-otonv3rl/uwsgi/setup.py';f=ge...

不写代码的博客 3833

基于传感器数据实现火灾报警预测分析

火警 系统当检测到烟雾、火灾、一氧化碳或其他与火灾有关或一般通知的紧急情况时,向人们发出警告

DT程序员的博客 728

如何使用freesurfer对T1w结构像进行分区指标的提取?——皮层面积,灰质体积,平均厚度,厚度标准差,平均曲率、高斯曲率、曲率指数、折叠指数

如何使用freesurfer对T1w结构像进行分区指标的提取?——皮层面积,灰质体积,平均厚度,厚度标准差,平均曲率、高斯曲率、曲率指数、折叠指数

从事脑科学核磁共振方法学研究,在Nature communications等权威期刊发表研究论文,熟练掌握磁共振处理方法和统计学方法,欢迎大家和我交流。 3791

【疑难杂症】Ubuntu安装uWsgi出现的问题

在Ubuntu环境下安装uWsgi的时候出现了一些问题 1:安装时出现错误: [x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o In file included from plugins/python/python_plugin.c:1:0: plugins/python/uwsgi_python...

m0_37702587的博客 1281

vb 6.0并口开发操作实例

vb6并口开发,简体中文,试例内有inpout32.dll动态链接库

ubuntu20.04 在virtualenv下安装uwsgi失败

我的环境:python3.8,ubuntu20.04 pycharm中使用python的虚拟环境下载uwsgi包失败: pip install uwsgi 解决办法: 需要安装Python3.8开发文件: sudo apt-get install python3.8-dev 上述命令将安装 Python 3 头文件以从源代码构建 uWSGI 之后再进到虚拟环境里安装uwsgi就可以了 ...

程序羊的博客 458

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

ubuntu安装uwsgi报错ERROR: Failed building wheel for uwsgi

在virtualenv下安装uwsgi失败 或者安装pymql失败 系统为ubuntu18.04 python版本为3.6.7 解决办法 sudo apt-get install build-essential libssl-dev libffi-dev python-dev 然后运行pip install uwsgi 转自https://blog.csdn.net/qq_39883035/art...

qq_34129700的博客 7161

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

Ubuntu环境下使用uWSGI服务器【以flask应用部署为例】

由于从Python 3.11开始限制了在系统级 Python 环境中使用 pip 安装第三方包,以避免与系统包管理器(如 apt)产生冲突。所以开发时选择使用虚拟环境。

人非生而知之者 1692

Ubuntu pip3安装uwsgi报错

笔者在ubuntu16.04使用pip3安装uwsgi时报错了,报错信息如下 leslie@leslie-TWS:~$ sudo pip3 ×××tall uwsgi The directory '/home/leslie/.cache/pip/http' or its parent directory is not owned by the current user and the cache ...

weixin_34228617的博客 1097

linux离线安装uwsgi,linux - 安装uwsgi失败

linux - 安装uwsgi失败大家讲道理2017-04-17 14:32:59 0 1 144deploy@ubuntu:dpkg$ sudo apt-get install -y uwsgiReading package lists... DoneBuilding dependency treeReading state information... DoneYou might wa...

weixin_33158363的博客 697

Django部署uwsgi

详细过程开发环境知识补充uWSGI安装配置uWSGIuWSGI的运行管理uWSGI的运行说明 开发环境 云服务器(Ubuntu),Django项目文件 知识补充 WSGI (Web Server Gateway Interface) Web服务器网关接口,是python应用程序或框架和web服务器之间的一种接口,被广泛使用。 在开发和测试环境中使用python manage.py runserver 开发结束后,使用WSGI在一个高效稳定的环境中运行完善的项目代码 uWSGI定义:uWSGI是WSGI的一种

weixin_44346972的博客 7992

基于nginx和uWSGI在Ubuntu上部署Django

转载自:http://www.jianshu.com/p/e6ff4a28ab5a 基于nginx和uWSGI在Ubuntu上部署Django 本文主要参考 uWSGI的文档 1. nginx 安装 sudo apt-get install nginx 启动、停止和重启 sudo /etc/init.d/nginx start sudo /etc/init.d/nginx s

King-duo博客 2258

ubuntu python3.7 安装uwsgi 常见错误

前言 由于需要在 ubuntu18.04 系统部署 django 项目,用到了 uWSGI 库,在安装的时候遇到了几个问题在这里记录一下原因,并附上解决方法。 Retrying (Retry(total=4, connect=None… 这是比较常见的问题,原因是安装超时,因为我们下载的库的源一般都是在国外,涉及到翻墙问题,解决方法是更换国内的源,注明的有阿里,豆瓣等,这里我用到的是豆瓣源: pi...

Ginta的博客 2413

Ubuntu-20.04 Flask Nginx uwsgi supervisor环境搭建

Ubuntu-20.04 Flask Nginx uwsgi supervisor环境搭建 文章目录Ubuntu-20.04 Flask Nginx uwsgi supervisor环境搭建实施步骤a. python的版本设定b. 安装Nginx安装Nginx过程,有可能需要依赖的库Nginx 基本配置c. 安装虚拟机环境 virtualenv虚拟环境操作命令d. 安装uwsgi安装uwsgi前,安装依赖包uwsgi 基本配置文件验证uwsgi配置是否正确e. 安装supervisor守护进程配置文件 最近

hapyandluck的博客 590
上一篇: 2018-2022 年份微博签到数据集
下一篇: git 仓库下 .git/objects/pack/ 文件太大解决办法
月小水长
月小水长 领域专家: 数据科学与机器学习技术领域 领域专家: 数据科学与机器学习技术领域
博客等级 码龄10年 1万+粉丝 132原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

月小水长

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

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

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

打赏作者

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

抵扣说明:

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

余额充值