Downgrade Python 3.7 to 3.5 on Raspbian Buster

Stigma picture Stigma · Jun 29, 2019 · Viewed 9.9k times · Source

So it seems like Buster comes default with 2.7 on load and an alternate 3.7 version of Python. However, I am using this Raspberry Pi 3 B+ just for an application that is only compatible with Python 3.5. How do run Python 3.5 as default version or remove 3.7 entirely from Buster?

Answer

Sourindu Chatterjee picture Sourindu Chatterjee · Jul 1, 2019

I truly believe that you can just install python3.5 from the source repos.

If you want to install python 3.5.4 :

sudo apt-get install python3.5

If you want to install python 3.5.3 (Debian Stretch) :

Edit as root /etc/apt/source.list and add the following repos,

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free

rpi firmware deb http://archive.raspberrypi.org/debian/ stretch main ui

Then install the specific package version from the target repo using the following command :

sudo apt-get install python3.5 -t stretch

If want to install pip3.5 (which i guess you would need) :

wget https://bootstrap.pypa.io/get-pip.py

python3.5 ./get-pip.py