I'm getting the following error when trying to install uwsgi using pip on ubuntu 18.04:
$ 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.
I have installed the python-dev
and python3-dev
packages. Running locate Python.h
shows that it is indeed installed:
/usr/include/python2.7/Python.h
/usr/include/python3.6m/Python.h
I've tried installing using both pip
and pip3
, and I get the same error. Every other answer to this question points to having python-dev
or python3-dev
or some variant installed, and I've tried all those. Any ideas what else might cause this?
This is exactly the same problem I've faced today after I upgraded from 3.6
to 3.7
.
Solve this problem by installing libpython3.7-dev
:sudo apt install libpython3.7-dev
/ libpython3.*-dev
which version you use.
then install uwsgi
again :pip install uwsgi
the output should look like:
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
Hope this help.
These two lines did the trick for me on Linux 8.2
yum install python3-devel
pip3 install uwsgi -vvv --no-cache-dir
My python version is 3.6, I do this to solve my problem:
yum -y install python36-devel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With