Downgrade Python 3.7 to 3.5 on Raspbian Buster

Viewed 16409

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?

3 Answers

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

just need to follow 1 step

do not remove python3.7 directly it will cause problems

install 3.5 and directly start using it. after 3.5 install you can remove python 3.7

keep it simple. :)

If you want to remove package any package:

sudo apt-get remove --purge package_name

So in your case:

sudo apt-get remove --purge python3.7

After if you want specific version download in manually and install. For example 3.5.2

wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
tar -xvf Python-3.5.2.tar.xz
cd Python-3.5.2
./configure
make -j4
make install
Related