安装 uwsgi报错解决

网友投稿 537 2022-11-06


安装 uwsgi报错解决

背景:

安装 uwsgi时报错如下,查阅相关资料说是 python-devel的问题,于是安装之后python-devel后问题解决

报错如下:

1 (venv) [xxxxxxx]# pip install uwsgi 2 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at 3 Looking in indexes: 4 Collecting uwsgi 5 Downloading (801kB) 6 |????????????????????????????????| 808kB 3.1MB/s 7 Building wheels for collected packages: uwsgi 8 Building wheel for uwsgi (setup.py) ... error 9 ERROR: Command errored out with exit status 1: 10 command: /xxxxxx/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy5kN5/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy5kN5/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-BZc6P_ --python-tag cp27 11 cwd: /tmp/pip-install-dy5kN5/uwsgi/ 12 Complete output (98 lines): 13 /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'descriptions' 14 warnings.warn(msg) 15 running bdist_wheel 16 running build 17 running build_py 18 creating build 19 creating build/lib 20 copying uwsgidecorators.py -> build/lib 21 installing to build/bdist.linux-x86_64/wheel 22 running install 23 using profile: buildconf/default.ini 24 detected include path: ['/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include', '/usr/local/include', '/usr/include'] 25 Patching "bin_name" to properly install_scripts dir 26 detected CPU cores: 1 27 configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -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.18\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="18" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -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(-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(28 *** uWSGI compiling server core *** 29 [gcc -pthread] core/utils.o 30 [gcc -pthread] core/protocol.o 31 [gcc -pthread] core/socket.o 32 [gcc -pthread] core/logging.o 33 [gcc -pthread] core/master.o 34 [gcc -pthread] core/master_utils.o 35 [gcc -pthread] core/emperor.o 36 [gcc -pthread] core/notify.o 37 [gcc -pthread] core/mule.o 38 [gcc -pthread] core/subscription.o 39 [gcc -pthread] core/stats.o 40 [gcc -pthread] core/sendfile.o 41 [gcc -pthread] core/async.o 42 [gcc -pthread] core/master_checks.o 43 [gcc -pthread] core/fifo.o 44 [gcc -pthread] core/offload.o 45 [gcc -pthread] core/io.o 46 [gcc -pthread] core/static.o 47 [gcc -pthread] core/websockets.o 48 [gcc -pthread] core/spooler.o 49 [gcc -pthread] core/snmp.o 50 [gcc -pthread] core/exceptions.o 51 [gcc -pthread] core/config.o 52 [gcc -pthread] core/setup_utils.o 53 [gcc -pthread] core/clock.o 54 [gcc -pthread] core/init.o 55 [gcc -pthread] core/buffer.o 56 [gcc -pthread] core/reader.o 57 [gcc -pthread] core/writer.o 58 [gcc -pthread] core/alarm.o 59 [gcc -pthread] core/cron.o 60 [gcc -pthread] core/hooks.o 61 [gcc -pthread] core/plugins.o 62 [gcc -pthread] core/lock.o 63 [gcc -pthread] core/cache.o 64 [gcc -pthread] core/daemons.o 65 [gcc -pthread] core/errors.o 66 [gcc -pthread] core/hash.o 67 [gcc -pthread] core/master_events.o 68 [gcc -pthread] core/chunked.o 69 [gcc -pthread] core/queue.o 70 [gcc -pthread] core/event.o 71 [gcc -pthread] core/signal.o 72 [gcc -pthread] core/strings.o 73 [gcc -pthread] core/progress.o 74 [gcc -pthread] core/timebomb.o 75 [gcc -pthread] core/ini.o 76 [gcc -pthread] core/fsmon.o 77 [gcc -pthread] core/mount.o 78 [gcc -pthread] core/metrics.o 79 [gcc -pthread] core/plugins_builder.o 80 [gcc -pthread] core/sharedarea.o 81 [gcc -pthread] core/rpc.o 82 [gcc -pthread] core/gateway.o 83 [gcc -pthread] core/loop.o 84 [gcc -pthread] core/cookie.o 85 [gcc -pthread] core/querystring.o 86 [gcc -pthread] core/rb_timers.o 87 [gcc -pthread] core/transformations.o 88 [gcc -pthread] core/uwsgi.o 89 [gcc -pthread] proto/base.o 90 [gcc -pthread] proto/uwsgi.o 91 [gcc -pthread] proto/92 [gcc -pthread] proto/fastcgi.o 93 [gcc -pthread] proto/scgi.o 94 [gcc -pthread] proto/puwsgi.o 95 [gcc -pthread] lib/linux_ns.o 96 [gcc -pthread] core/zlib.o 97 [gcc -pthread] core/regexp.o 98 [gcc -pthread] core/routing.o 99 [gcc -pthread] core/yaml.o100 [gcc -pthread] core/ssl.o101 [gcc -pthread] core/legion.o102 [gcc -pthread] core/dot_h.o103 [gcc -pthread] core/config_py.o104 *** uWSGI compiling embedded plugins ***105 [gcc -pthread] plugins/python/python_plugin.o106 In file included from plugins/python/python_plugin.c:1:0:107 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory108 #include 109 ^110 compilation terminated.111 ----------------------------------------112 ERROR: Failed building wheel for uwsgi113 Running setup.py clean for uwsgi114 Failed to build uwsgi115 Installing collected packages: uwsgi116 Running setup.py install for uwsgi ... error117 ERROR: Command errored out with exit status 1:118 command: /xxxxxxxx/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy5kN5/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy5kN5/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-z3qq7P/install-record.txt --single-version-externally-managed --compile --install-headers /xxxxxxxx/include/site/python2.7/uwsgi119 cwd: /tmp/pip-install-dy5kN5/uwsgi/120 Complete output (91 lines):121 /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'descriptions'122 warnings.warn(msg)123 running install124 using profile: buildconf/default.ini125 detected include path: ['/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include', '/usr/local/include', '/usr/include']126 Patching "bin_name" to properly install_scripts dir127 detected CPU cores: 1128 configured CFLAGS: -O2 -I. -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -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.18\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="18" -DUWSGI_VERSION_REVISION="0" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -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(-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( *** uWSGI compiling server core ***130 core/utils.o is up to date131 core/protocol.o is up to date132 core/socket.o is up to date133 core/logging.o is up to date134 core/master.o is up to date135 core/master_utils.o is up to date136 core/emperor.o is up to date137 core/notify.o is up to date138 core/mule.o is up to date139 core/subscription.o is up to date140 core/stats.o is up to date141 core/sendfile.o is up to date142 core/async.o is up to date143 core/master_checks.o is up to date144 core/fifo.o is up to date145 core/offload.o is up to date146 core/io.o is up to date147 core/static.o is up to date148 core/websockets.o is up to date149 core/spooler.o is up to date150 core/snmp.o is up to date151 core/exceptions.o is up to date152 core/config.o is up to date153 core/setup_utils.o is up to date154 core/clock.o is up to date155 core/init.o is up to date156 core/buffer.o is up to date157 core/reader.o is up to date158 core/writer.o is up to date159 core/alarm.o is up to date160 core/cron.o is up to date161 core/hooks.o is up to date162 core/plugins.o is up to date163 core/lock.o is up to date164 core/cache.o is up to date165 core/daemons.o is up to date166 core/errors.o is up to date167 core/hash.o is up to date168 core/master_events.o is up to date169 core/chunked.o is up to date170 core/queue.o is up to date171 core/event.o is up to date172 core/signal.o is up to date173 core/strings.o is up to date174 core/progress.o is up to date175 core/timebomb.o is up to date176 core/ini.o is up to date177 core/fsmon.o is up to date178 core/mount.o is up to date179 core/metrics.o is up to date180 core/plugins_builder.o is up to date181 core/sharedarea.o is up to date182 core/rpc.o is up to date183 core/gateway.o is up to date184 core/loop.o is up to date185 core/cookie.o is up to date186 core/querystring.o is up to date187 core/rb_timers.o is up to date188 core/transformations.o is up to date189 core/uwsgi.o is up to date190 proto/base.o is up to date191 proto/uwsgi.o is up to date192 proto/is up to date193 proto/fastcgi.o is up to date194 proto/scgi.o is up to date195 proto/puwsgi.o is up to date196 lib/linux_ns.o is up to date197 core/zlib.o is up to date198 core/regexp.o is up to date199 core/routing.o is up to date200 core/yaml.o is up to date201 core/ssl.o is up to date202 core/legion.o is up to date203 [gcc -pthread] core/dot_h.o204 [gcc -pthread] core/config_py.o205 *** uWSGI compiling embedded plugins ***206 [gcc -pthread] plugins/python/python_plugin.o207 In file included from plugins/python/python_plugin.c:1:0:208 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory209 #include 210 ^211 compilation terminated.212 ----------------------------------------213 ERROR: Command errored out with exit status 1: /xxxxxxx/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy5kN5/uwsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy5kN5/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-z3qq7P/install-record.txt --single-version-externally-managed --compile --install-headers /xxxxxxxx/include/site/python2.7/uwsgi Check the logs for

View Code

解决:

安装 python-devel

yum install python-devel

安装完成后再安装 uwsgi,成功安装

pip install uwsgi


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Linux学习笔记之Linux相关知识
下一篇:详解Java中的ReentrantLock锁
相关文章

 发表评论

暂时没有评论,来抢沙发吧~