I'm trying to install uswgi in a virutal env on linux ubuntu, python 3.5.2 I do
pip install uwsgi
I got this error
Failed building wheel for uwsgi
and at the end of the installing logs
*** uWSGI compiling embedded plugins *** [thread 0][x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o [thread 1][x86_64-linux-gnu-gcc -pthread] plugins/python/pyutils.o 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. In file included from plugins/python/pyutils.c:1:0: plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory compilation terminated. ---------------------------------------- Command "/home/ubuntu/envflask/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wthov1ur/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-quiupta5-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/envflask/env/include/site/python3.5/uwsgi" failed with error code 1 in /tmp/pip-build-wthov1ur/uwsgi/
It is any solution for this? Thanks
Check for the existence of the socket files within the /run/uwsgi directory by typing: sudo ls /run/uwsgi.
The uwsgi binary is placed in /usr/bin/uwsgi when installing uwsgi this way.
It appears that uwsgi in the version that is packaged for Ubuntu 18.04. 4 defaults to using the python plugin, which means Python 2.
You need to install Python3.5 development files, so run this command:
apt-get install python3.5-dev
The above command will install Python 3 headers to build uWSGI from source.
apt-get install build-essential python3-dev
From the uWSGI documentation:
uWSGI is a (big) C application, so you need a C compiler (like gcc or clang) and the Python development headers. On a Debian-based distro an
apt-get install build-essential python-dev
will be enough.
For Python3, just change that to python3-dev
.
$ python3 --version Python 3.5.2 $ pip3 freeze uWSGI==2.0.15
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