How to use uWSGI with Python3.6 in Ubuntu

Step-by-step how-to to use uWSGI with python3.6 for Ubuntu 16.10/17.04.

© 2017 Paolo Melchiorre CC BY-SA “Photo taken in the historic center of Florence (Italy) during the DjancoCon Europe 2017”
© 2017 Paolo Melchiorre CC BY-SA “Photo taken in the historic center of Florence (Italy) during the DjancoCon Europe 2017”
Development with uWSGI (3 part series)
  1. How to use uWSGI with Python3.6 in Ubuntu
  2. How to use uWSGI Avahi plugin in Ubuntu
  3. How to use uWSGI with Python 3.7 in Ubuntu 18

Setup

$ sudo apt install \
libcap-dev \
libpcre3-dev \
python3.6-dev \
uuid-dev \
uwsgi \
uwsgi-src
$ cd ~
$ export PYTHON=python3.6
$ uwsgi --build-plugin \
"/usr/src/uwsgi/plugins/python python36"
$ sudo mv \
python36_plugin.so \
/usr/lib/uwsgi/plugins/python36_plugin.so
$ sudo chmod 644 \
/usr/lib/uwsgi/plugins/python36_plugin.so

Tests

Ubuntu 16.10

$ uwsgi --plugin python36 -s :0

Python version: 3.6.0b2 …

Ubuntu 17.04

$ uwsgi --plugin python36 -s :0

Python version: 3.6.1 …