Error installing uwsgi in virtualenv

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


For anyone with python 3.6 facing the same problem here is the step to solve it :

Get python 3.6 dev tools from this ppa:

sudo add-apt-repository ppa:deadsnakes/ppa

Then update your package list with :

sudo apt-get update

and then install your dev tools with 3.6 version

apt-get install build-essential python3.6-dev

Activate your virtual environment with and then install uwsgi:

pip install uwsgi