安装uwsgi 报错问题解决 您所在的位置:网站首页 pip安装uwsgi报错 安装uwsgi 报错问题解决

安装uwsgi 报错问题解决

2023-08-18 16:40| 来源: 网络整理| 查看: 265

在安装uwsgi 时报错:

image.png

 ERROR: Command errored out with exit status 1:      command: /home/yuchuan/bin/virtualenv/proenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zxwetjyh/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zxwetjyh/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-07qonhkc/install-record.txt --single-version-externally-managed --compile --install-headers /home/yuchuan/bin/virtualenv/proenv/include/site/python3.6/uwsgi          cwd: /tmp/pip-install-zxwetjyh/uwsgi/     Complete output (86 lines):     /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/lib/gcc/x86_64-redhat-linux/4.8.5/include', '/usr/local/include', '/usr/include']     Patching "bin_name" to properly install_scripts dir     detected CPU cores: 1     configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format     *** uWSGI compiling server core ***     [gcc -pthread] core/utils.o     [gcc -pthread] core/protocol.o     [gcc -pthread] core/socket.o     [gcc -pthread] core/logging.o     [gcc -pthread] core/master.o     [gcc -pthread] core/master_utils.o     [gcc -pthread] core/emperor.o     [gcc -pthread] core/notify.o     [gcc -pthread] core/mule.o     *** uWSGI compiling embedded plugins ***     [gcc -pthread] plugins/python/python_plugin.o     In file included from plugins/python/python_plugin.c:1:0:     plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory      #include                          ^     compilation terminated.     ERROR: Command errored out with exit status 1: /home/yuchuan/bin/virtualenv/proenv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zxwetjyh/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zxwetjyh/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-07qonhkc/install-record.txt --single-version-externally-managed --compile --install-headers /home/yuchuan/bin/virtualenv/proenv/include/site/python3.6/uwsgi Check the logs for full command output.

原因分析:

原来,它找不到Python.h。安装python2.7-dev为我解决了这个问题。

我正在将Anaconda用于python3。我与OP发生了相同的错误(由“ LTO版本”引起),结果我必须安装不同的编译器:

解决方案:

(proenv) [root@TXMaster edupro]# yum install gcc python36-devel

安装相关依赖后再安装uwsgi

(proenv) [yuchuan@TXMaster edupro]$ pip install uwsgi Collecting uwsgi   Using cached uWSGI-2.0.19.1.tar.gz (803 kB) Using legacy 'setup.py install' for uwsgi, since package 'wheel' is not installed. Installing collected packages: uwsgi     Running setup.py install for uwsgi ... done Successfully installed uwsgi-2.0.19.1 (proenv) [yuchuan@TXMaster edupro]$ ll

成功安装。



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有