尝试在 ubuntu 18.04 上使用 pip 安装 uwsgi 时出现以下错误:
$ sudo pip3 install uwsgi
...
plugins/python/uwsgi_python.h:2:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
我已经安装了python-dev和python3-dev包。运行locate Python.h显示确实安装了:
/usr/include/python2.7/Python.h
/usr/include/python3.6m/Python.h
Run Code Online (Sandbox Code Playgroud)
我试过同时使用pipand 进行安装pip3,但出现相同的错误。每隔回答这个问题分有python-dev或python3-dev或其变型安装的,我已经尝试了所有这些。任何想法还有什么可能导致这种情况?
iCo*_*yer 12
这也正是我今天所面临后我从升级同样的问题3.6来3.7。
通过安装libpython3.7-dev:
sudo apt install libpython3.7-dev/libpython3.*-dev您使用的版本来解决此问题。
然后uwsgi再次安装:
pip install uwsgi
输出应如下所示:
Building wheels for collected packages: uwsgi
Running setup.py bdist_wheel for uwsgi ... done
Stored in directory: /home/user/.cache/pip/wheels/2d/0c/b0/f3ba1bbce35c3766c9dac8c3d15d5431cac57e7a8c4111c268
Successfully built uwsgi
Installing collected packages: uwsgi, weasyprint
Successfully installed uwsgi-2.0.18 weasyprint-50
Run Code Online (Sandbox Code Playgroud)
希望这有帮助。
小智 7
这两行在 Linux 8.2 上对我有用
yum install python3-devel
pip3 install uwsgi -vvv --no-cache-dir
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3798 次 |
| 最近记录: |