當前位置: 首頁>>技術教程>>正文


python – 通過 pip 安裝 uwsgi 1.2.5

, , ,

問題描述

歡迎,

目前我正在嘗試根據站點的說明在我的 VPS (Ubuntu 11.10) 上安裝最新的 uwsgi\n http://projects.unbit.it/uwsgi/wiki/Quickstart

pip install uwsgi

在編譯期間,我看到一些錯誤:

...
[gcc -pthread] spooler.o
*** uWSGI compiling embedded plugins ***
[gcc -pthread] plugins/python/python_plugin.o
Complete output from command /usr/bin/python -c "import setuptools;__file__='/etc/apt/sources.list.d/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-joud1I-record/install-record.txt:
running install

In file included from plugins/python/python_plugin.c:1:0:

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

compilation terminated.

using profile: buildconf/default.ini

detected include path: ['/usr/lib/gcc/i686-linux-gnu/4.6.1/include','/usr/local/include', '/usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed', '/usr/include/i386-linux-gnu', '/usr/include']

Patching "bin_name" to properly install_scripts dir
...

最後我看到:

...

[gcc -pthread] spooler.o

*** uWSGI compiling embedded plugins ***

[gcc -pthread] plugins/python/python_plugin.o

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/etc/apt/sources.list.d/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-joud1I-record/install-record.txt failed with error code 1 in /etc/apt/sources.list.d/build/uwsgi
Storing complete log in /root/.pip/pip.log

有沒有人建議我如何安裝最新的 uwsgi?

問候,\n格熱戈茲

最佳回答

\\n

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

\\n

要為 Python 編譯 C 擴展,您需要 Python 開發文件:

$ sudo apt-get install python2.7-dev

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/12851.html,未經允許,請勿轉載。