华为鲲鹏云服务器安装uWSGI

举报
mianyan 发表于 2021/01/27 23:17:10 2021/01/27
【摘要】 关于华为aarch64架构的鲲鹏920云服务器,在安装uWSGI时报错缺少Python.h的问题,系统为centos8。解决办法是需要platform-python-devel.aarch64这一源码库,并不是正常的python-devel

正常pip安装时报错:

Installing collected packages: uwsgi
  Running setup.py install for uwsgi ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-07l7onhp/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-e809_7gt-record/install-record.txt --single-version-externally-managed --compile:
    /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/aarch64-redhat-linux/8/include', '/usr/local/include', '/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 -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -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_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(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 0][gcc -pthread] core/utils.o
    [thread 1][gcc -pthread] core/protocol.o
    [thread 1][gcc -pthread] core/socket.o
    [thread 1][gcc -pthread] core/logging.o
    [thread 0][gcc -pthread] core/master.o
    [thread 1][gcc -pthread] core/master_utils.o
    [thread 0][gcc -pthread] core/emperor.o
    [thread 1][gcc -pthread] core/notify.o
    [thread 1][gcc -pthread] core/mule.o
    [thread 0][gcc -pthread] core/subscription.o
    [thread 1][gcc -pthread] core/stats.o
    [thread 0][gcc -pthread] core/sendfile.o
    [thread 0][gcc -pthread] core/async.o
    [thread 1][gcc -pthread] core/master_checks.o
    [thread 0][gcc -pthread] core/fifo.o
    [thread 1][gcc -pthread] core/offload.o
    [thread 0][gcc -pthread] core/io.o
    [thread 1][gcc -pthread] core/static.o
    [thread 1][gcc -pthread] core/websockets.o
    [thread 0][gcc -pthread] core/spooler.o
    [thread 1][gcc -pthread] core/snmp.o
    [thread 0][gcc -pthread] core/exceptions.o
    [thread 1][gcc -pthread] core/config.o
    [thread 0][gcc -pthread] core/setup_utils.o
    [thread 0][gcc -pthread] core/clock.o
    [thread 1][gcc -pthread] core/init.o
    [thread 0][gcc -pthread] core/buffer.o
    [thread 1][gcc -pthread] core/reader.o
    [thread 0][gcc -pthread] core/writer.o
    [thread 1][gcc -pthread] core/alarm.o
    [thread 0][gcc -pthread] core/cron.o
    [thread 1][gcc -pthread] core/hooks.o
    [thread 0][gcc -pthread] core/plugins.o
    [thread 1][gcc -pthread] core/lock.o
    [thread 0][gcc -pthread] core/cache.o
    [thread 1][gcc -pthread] core/daemons.o
    [thread 1][gcc -pthread] core/errors.o
    [thread 1][gcc -pthread] core/hash.o
    [thread 0][gcc -pthread] core/master_events.o
    [thread 1][gcc -pthread] core/chunked.o
    [thread 0][gcc -pthread] core/queue.o
    [thread 1][gcc -pthread] core/event.o
    [thread 0][gcc -pthread] core/signal.o
    [thread 1][gcc -pthread] core/strings.o
    [thread 0][gcc -pthread] core/progress.o
    [thread 1][gcc -pthread] core/timebomb.o
    [thread 0][gcc -pthread] core/ini.o
    [thread 1][gcc -pthread] core/fsmon.o
    [thread 0][gcc -pthread] core/mount.o
    [thread 1][gcc -pthread] core/metrics.o
    [thread 0][gcc -pthread] core/plugins_builder.o
    [thread 0][gcc -pthread] core/sharedarea.o
    [thread 1][gcc -pthread] core/rpc.o
    [thread 0][gcc -pthread] core/gateway.o
    [thread 1][gcc -pthread] core/loop.o
    [thread 0][gcc -pthread] core/cookie.o
    [thread 1][gcc -pthread] core/querystring.o
    [thread 0][gcc -pthread] core/rb_timers.o
    [thread 1][gcc -pthread] core/transformations.o
    [thread 0][gcc -pthread] core/uwsgi.o
    [thread 1][gcc -pthread] proto/base.o
    [thread 1][gcc -pthread] proto/uwsgi.o
    [thread 1][gcc -pthread] proto/http.o
    [thread 1][gcc -pthread] proto/fastcgi.o
    [thread 1][gcc -pthread] proto/scgi.o
    [thread 1][gcc -pthread] proto/puwsgi.o
    [thread 1][gcc -pthread] lib/linux_ns.o
    [thread 0][gcc -pthread] core/zlib.o
    [thread 1][gcc -pthread] core/yaml.o
    [thread 0][gcc -pthread] core/ssl.o
    [thread 1][gcc -pthread] core/legion.o
    [thread 0][gcc -pthread] core/dot_h.o
    [thread 0][gcc -pthread] core/config_py.o
    *** uWSGI compiling embedded plugins ***
    [thread 0][gcc -pthread] plugins/python/python_plugin.o
    In file included from plugins/python/python_plugin.c:1:
    plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    
    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-07l7onhp/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-e809_7gt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-07l7onhp/uwsgi/

解决办法

  • 安装aarch64专用的python源码库
yum install platform-python-devel.aarch64
pip3 install uwsgi
  • yum源中的信息
yum search python-devel
Last metadata expiration check: 2:40:20 ago on Wed 27 Jan 2021 08:10:18 PM CST.
========================================== Name Matched: python-devel ========================================
nautilus-python-devel.aarch64 : Python bindings for Nautilus
platform-python-devel.aarch64 : Libraries and header files needed for Python development
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。