TLJH Installation failure

While trying to install Littlest JupyterHub on my own server running Ubuntu 18.04, I get the following error:

Setting up JupyterHub…
Ran /opt/tljh/hub/bin/python -m pip install --no-cache-dir pycurl==7.43.* with exit code 1
Collecting pycurl==7.43.*
Downloading https :// (215kB)
Installing collected packages: pycurl
Running install for pycurl: started
Running install for pycurl: finished with status ‘error’
Complete output from command /opt/tljh/hub/bin/python -u -c “import setuptools, tokenize;file=’/tmp/pip-build-mbi_q9aa/pycurl/’;f=getattr(tokenize, ‘open’, open)(file);’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-zrww2ae0-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/tljh/hub/include/site/python3.6/pycurl:
Using curl-config (libcurl 7.58.0)
Using SSL library: OpenSSL/LibreSSL/BoringSSL
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/curl
copying python/curl/ -> build/lib.linux-x86_64-3.6/curl
running build_ext
building ‘pycurl’ extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION=“” -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/opt/tljh/hub/include -I/usr/include/python3.6m -c src/docstrings.c -o build/temp.linux-x86_64-3.6/src/docstrings.o
In file included from src/docstrings.c:4:0:
src/pycurl.h:4:10: fatal error: Python.h: No such file or directory
#include <Python.h>
compilation terminated.
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1 ----------------------------------------
Command “/opt/tljh/hub/bin/python -u -c “import setuptools, tokenize;file=’/tmp/pip-build-mbi_q9aa/pycurl/’;f=getattr(tokenize, ‘open’, open)(file);’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-zrww2ae0-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/tljh/hub/include/site/python3.6/pycurl” failed with error code 1 in /tmp/pip-build-mbi_q9aa/pycurl/
Traceback (most recent call last):
File “/usr/lib/python3.6/”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/”, line 85, in _run_code
exec(code, run_globals)
File “/opt/tljh/hub/lib/python3.6/site-packages/tljh/”, line 482, in
File “/opt/tljh/hub/lib/python3.6/site-packages/tljh/”, line 469, in main
File “/opt/tljh/hub/lib/python3.6/site-packages/tljh/”, line 201, in ensure_jupyterhub_package
File “/opt/tljh/hub/lib/python3.6/site-packages/tljh/”, line 135, in ensure_pip_packages
] + packages)
File “/opt/tljh/hub/lib/python3.6/site-packages/tljh/”, line 28, in run_subprocess
raise subprocess.CalledProcessError(cmd=cmd, returncode=proc.returncode)
subprocess.CalledProcessError: Command ‘[’/opt/tljh/hub/bin/python’, ‘-m’, ‘pip’, ‘install’, ‘–no-cache-dir’, 'pycurl==7.43.
’]’ returned non-zero exit status 1.

It is worth mentioning that I have managed to install littlest jupyterhub on identical setup (ubuntu 18.04) two months back and it is still working today.
Issues #444 and #450 created on github seem similar to my untrained eye.
Thanks for help!

Most of the time these are dependency-issues. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. When encountering this error please note before the error it may say you are missing a package or header file — you should find those and install them and verify if it works

For Python 2.x use:

$ sudo apt-get install python-dev

If you using python 3, try to replace python-dev with python3-dev

For a specific version of Python 3, replace x with the minor version in

$ sudo apt-get install python3.x-dev