安装uwsgi报错

博客详细记录了在Ubuntu和CentOS系统中安装uwsgi时遇到的错误及其解决过程。错误主要由于缺少Python头文件导致,解决方案包括安装python-dev或python3-dev等依赖。对于CentOS,需要根据系统版本安装相应的python3-devel。此外,文章提到了在不同Python环境下安装uwsgi的兼容性问题,指出uwsgi 2.0.20版本需要Python 3.6或3.7环境。最后,文章提供了安装uwsgi的详细步骤和注意事项。

ubuntu执行pip3 install uwsgi后报错。

CentOS7执行pip3 install uwsgi也报这个错,所以当时又尝试yum install uwsgi,没报错,应该是装的时候依赖已经都装好了。但后来发现,这个用yum安装的uwsgi,用它启动flask项目后,访问项目报错Internal Server Error,把项目复制到别人服务器却能正常访问,怀疑是因为不能用yum安装的uwsgi,而且还遇到ps -ef | grep uwsgi显示的进程号与uwsgi.pid文件(uwsgi.ini里配置的)中的不一致,所以卸载了yum安装的uwsgi,然后尝试各种修改后还是报Internal Server Error,没办法了直接重置服务器,并且换成了CentOS 8.2,执行pip install uwsgi还是报这个错。

Building wheel for uwsgi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k8k02_sl/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k8k02_sl/uwsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-a7zocrcr
       cwd: /tmp/pip-install-k8k02_sl/uwsgi/
  Complete output (102 lines):
  /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  copying uwsgidecorators.py -> build/lib
  installing to build/bdist.linux-x86_64/wheel
  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: 4
  configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY  -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_VERSION="\"2.0.19.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="19" -DUWSGI_VERSION_REVISION="1" -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 ***
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/utils.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/protocol.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/socket.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/logging.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/master.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/master_utils.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/emperor.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/notify.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/mule.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/subscription.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/stats.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/sendfile.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/async.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/master_checks.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/fifo.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/offload.o
  [thread 3][x86_64
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值