Ubuntu 18.04 comes with Python 3.6 preinstalled. Recently I checked out a private project that uses Pipfile and the project requires Python 3.5.
[requires] python_version = "3.5"
I tried to install Django Compressor, but it failed because
rcssmin could not be installed. I’ve found an existing issue which suggested installing the package with
pip install rjsmin --install-option="--without-c-extensions"
But Pipenv does not support this flag (at least not that I would know). And also it would make Compressor much slower. So instead I installed
sudo apt install python3.5-dev
pipenv install django-compressor
again. It should install properly without any exceptions.
If any installation of Python packages fails, try installing Python header files for the correct version of Python that the virtual environment is using.