Unable to download newest library versions on Ubuntu 18.04 LTS

Not only with Django is this a problem, but everything else.

I have updated and upgraded pip, I have tried python3, pip3 everything.

Taking Pillow (the image library) for example.
python -m pip install pillow wouldn’t work to install 9.2.0

I tried:
pip install --no-cache-dir --upgrade Pillow
and this would install 8.4.0, a legacy version.
I also made a symbolic link so that my python version matches my python3 version.
I wouldn’t care just for the fact that I can now never make a Docker build because it will always fail on the requirements file due to legacy versions being installed (on libraries that I need).

I’m currently trying to compile the Pillow library from source…

the solution to my problem was to install a new version of python which was greater than 3.6.9.
I had 3.6.9 installed and the latest Pillow lib (as well as other libraries) require python>=3.7

I installed python 3.8 with:
sudo apt-get install python3.8

then I used sudo update-alternatives to set it

Note: You can also directly create virtual environments using newer versions of python by specifying the precise version.
example: python3.8 -m venv env_dir

Also, you may wish to install the deadsnakes PPA if you wish to install the most current versions (3.10+)

1 Like