あるフリーランスエンジニアの色んなメモ!! ITスキル・ライフハックとか

Debian系:pipでuwsgiをインストールする

必要なpackageのインストール

Python2系でuwsgiを使用する場合

apt-get install -y gcc python2.7-dev

Python3系でuwsgiを使用する場合

apt-get install -y gcc python3-dev

packageが不足している場合のエラー

pip install uwsgi
Collecting uwsgi
  Using cached https://files.pythonhosted.org/packages/a2/c9/a2d5737f63cd9df4317a4acc15d1ddf4952e28398601d8d7d706c16381e0/uwsgi-2.0.17.1.tar.gz
Building wheels for collected packages: uwsgi
  Running setup.py bdist_wheel for uwsgi ... error
  Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lbdb9gq3/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-tabhcviq --python-tag cp36:
  /usr/local/lib/python3.6/distutils/dist.py:261: 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/6/include', '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed', '/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_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_TIMER_USE_TIMERFD_NOINC -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.17.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="17" -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(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(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 2][gcc -pthread] core/socket.o
  [thread 3][gcc -pthread] core/logging.o
  In file included from core/utils.c:1:0:
  ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
   #include <stdio.h>
                     ^
  In file included from core/protocol.c:1:0:
  ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
   #include <stdio.h>
                     ^
  compilation terminated.
  compilation terminated.
  In file included from core/logging.c:2:0:
  ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
   #include <stdio.h>
                     ^
  compilation terminated.
  In file included from core/socket.c:1:0:
  ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
   #include <stdio.h>
                     ^
  compilation terminated.

  ----------------------------------------
  Failed building wheel for uwsgi
  Running setup.py clean for uwsgi
Failed to build uwsgi
Installing collected packages: uwsgi
  Running setup.py install for uwsgi ... error
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lbdb9gq3/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-rejxmt8l/install-record.txt --single-version-externally-managed --compile:
    /usr/local/lib/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-linux-gnu/6/include', '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed', '/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_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_TIMER_USE_TIMERFD_NOINC -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.17.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="17" -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(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(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 2][gcc -pthread] core/utils.o
    [thread 1][gcc -pthread] core/protocol.o
    [thread 0][gcc -pthread] core/socket.o
    [thread 3][gcc -pthread] core/logging.o
    In file included from core/utils.c:1:0:
    ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
     #include <stdio.h>
                       ^
    compilation terminated.
    In file included from core/socket.c:1:0:
    ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
     #include <stdio.h>
                       ^
    compilation terminated.
    In file included from core/logging.c:2:0:
    ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
     #include <stdio.h>
                       ^
    compilation terminated.
    In file included from core/protocol.c:1:0:
    ./uwsgi.h:165:19: fatal error: stdio.h: No such file or directory
     #include <stdio.h>
                       ^
    compilation terminated.

    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lbdb9gq3/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-rejxmt8l/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-lbdb9gq3/uwsgi/
comments powered by Disqus