无法在基于 CentOS 的 VPS 上构建 uwsgi
Failed to build uwsgi on CentOS based VPS
我在 CentOS VPS(由 GoDaddy 托管)上安装 uwsgi 时遇到问题。我从源代码编译最新的 python,安装 pip 和 virtualenv,当我尝试安装 uwsgi 时,出现错误:
(coderhein)jarvis@server [~]# pip install uwsgi
Collecting uwsgi
Downloading uwsgi-2.0.11.1.tar.gz (782kB)
100% |████████████████████████████████| 782kB 506kB/s
Building wheels for collected packages: uwsgi
Running setup.py bdist_wheel for uwsgi
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpeGEhfDpip-wheel-:
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
----------------------------------------
Failed building wheel for uwsgi
Failed to build uwsgi
Installing collected packages: uwsgi
Running setup.py install for uwsgi
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F6Mjjq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uwsgi:
running install
----------------------------------------
Command "/home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F6Mjjq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uwsgi" failed with error code 1 in /tmp/pip-build-KonabN/uwsgi
有什么问题吗?我不熟悉基于 RHEL 的发行版,也不知道我需要做什么。提前致谢
更新。当我再次尝试构建 uwsgi 时,出现了另一个错误:
(coderhein)jarvis@server [~]# pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz
Collecting http://projects.unbit.it/downloads/uwsgi-lts.tar.gz
Downloading http://projects.unbit.it/downloads/uwsgi-lts.tar.gz (782kB)
100% |████████████████████████████████| 782kB 290kB/s
Building wheels for collected packages: uWSGI
Running setup.py bdist_wheel for uWSGI
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpGH9mvHpip-wheel-:
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
----------------------------------------
Failed building wheel for uWSGI
Failed to build uWSGI
Installing collected packages: uWSGI
Running setup.py install for uWSGI
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oKtSFn-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uWSGI:
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Patching "bin_name" to properly install_scripts dir
detected CPU cores: 24
configured CFLAGS: -O2 -I. -Wall -Werror -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.11.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="11" -DUWSGI_VERSION_REVISION="1" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -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
[thread 1][gcc -pthread] core/init.o
[thread 2][gcc -pthread] core/buffer.o
[thread 3][gcc -pthread] core/reader.o
[thread 4][gcc -pthread] core/writer.o
[thread 5][gcc -pthread] core/alarm.o
[thread 6][gcc -pthread] core/cron.o
[thread 7][gcc -pthread] core/hooks.o
[thread 8][gcc -pthread] core/plugins.o
[thread 9][gcc -pthread] core/lock.o
[thread 10][gcc -pthread] core/cache.o
[thread 11][gcc -pthread] core/daemons.o
[thread 12][gcc -pthread] core/errors.o
[thread 13][gcc -pthread] core/hash.o
[thread 14][gcc -pthread] core/master_events.o
[thread 15][gcc -pthread] core/chunked.o
[thread 16][gcc -pthread] core/queue.o
[thread 17][gcc -pthread] core/event.o
[thread 18][gcc -pthread] core/signal.o
[thread 19][gcc -pthread] core/strings.o
[thread 20][gcc -pthread] core/progress.o
[thread 21][gcc -pthread] core/timebomb.o
[thread 22][gcc -pthread] core/ini.o
[thread 23][gcc -pthread] co
----------------------------------------
Command "/home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oKtSFn-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uWSGI" failed with error code 1 in /tmp/pip-Rgghm2-build
好的,我的问题解决了。我只是下载 uwsgi 源代码并使用它构建:
python uwsgiconfig.py --build core
更新。在构建之前,我在 buldconfig/core.ini
中指定了二进制名称和插件目录
我在 CentOS VPS(由 GoDaddy 托管)上安装 uwsgi 时遇到问题。我从源代码编译最新的 python,安装 pip 和 virtualenv,当我尝试安装 uwsgi 时,出现错误:
(coderhein)jarvis@server [~]# pip install uwsgi
Collecting uwsgi
Downloading uwsgi-2.0.11.1.tar.gz (782kB)
100% |████████████████████████████████| 782kB 506kB/s
Building wheels for collected packages: uwsgi
Running setup.py bdist_wheel for uwsgi
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpeGEhfDpip-wheel-:
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
----------------------------------------
Failed building wheel for uwsgi
Failed to build uwsgi
Installing collected packages: uwsgi
Running setup.py install for uwsgi
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F6Mjjq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uwsgi:
running install
----------------------------------------
Command "/home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-KonabN/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F6Mjjq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uwsgi" failed with error code 1 in /tmp/pip-build-KonabN/uwsgi
有什么问题吗?我不熟悉基于 RHEL 的发行版,也不知道我需要做什么。提前致谢
更新。当我再次尝试构建 uwsgi 时,出现了另一个错误:
(coderhein)jarvis@server [~]# pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz
Collecting http://projects.unbit.it/downloads/uwsgi-lts.tar.gz
Downloading http://projects.unbit.it/downloads/uwsgi-lts.tar.gz (782kB)
100% |████████████████████████████████| 782kB 290kB/s
Building wheels for collected packages: uWSGI
Running setup.py bdist_wheel for uWSGI
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpGH9mvHpip-wheel-:
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
----------------------------------------
Failed building wheel for uWSGI
Failed to build uWSGI
Installing collected packages: uWSGI
Running setup.py install for uWSGI
Complete output from command /home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oKtSFn-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uWSGI:
running install
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Patching "bin_name" to properly install_scripts dir
detected CPU cores: 24
configured CFLAGS: -O2 -I. -Wall -Werror -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.11.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="11" -DUWSGI_VERSION_REVISION="1" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -I/usr/include/libxml2 -DUWSGI_XML -DUWSGI_XML_LIBXML2 -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
[thread 1][gcc -pthread] core/init.o
[thread 2][gcc -pthread] core/buffer.o
[thread 3][gcc -pthread] core/reader.o
[thread 4][gcc -pthread] core/writer.o
[thread 5][gcc -pthread] core/alarm.o
[thread 6][gcc -pthread] core/cron.o
[thread 7][gcc -pthread] core/hooks.o
[thread 8][gcc -pthread] core/plugins.o
[thread 9][gcc -pthread] core/lock.o
[thread 10][gcc -pthread] core/cache.o
[thread 11][gcc -pthread] core/daemons.o
[thread 12][gcc -pthread] core/errors.o
[thread 13][gcc -pthread] core/hash.o
[thread 14][gcc -pthread] core/master_events.o
[thread 15][gcc -pthread] core/chunked.o
[thread 16][gcc -pthread] core/queue.o
[thread 17][gcc -pthread] core/event.o
[thread 18][gcc -pthread] core/signal.o
[thread 19][gcc -pthread] core/strings.o
[thread 20][gcc -pthread] core/progress.o
[thread 21][gcc -pthread] core/timebomb.o
[thread 22][gcc -pthread] core/ini.o
[thread 23][gcc -pthread] co
----------------------------------------
Command "/home/jarvis/.envs/coderhein/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-Rgghm2-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oKtSFn-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jarvis/.envs/coderhein/include/site/python2.7/uWSGI" failed with error code 1 in /tmp/pip-Rgghm2-build
好的,我的问题解决了。我只是下载 uwsgi 源代码并使用它构建:
python uwsgiconfig.py --build core
更新。在构建之前,我在 buldconfig/core.ini
中指定了二进制名称和插件目录