How to install Python 3.7+ on your Raspberry Pi 3

How to install Python 3.7+ on your Raspberry Pi 3

GET THE DEPENDENCIES OUT OF THE WAY

sudo apt-get -y install build-essential libc6-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev screen tk-dev python-dev uuid-dev

STARTUP A SCREEN SESSION IN CASE YOU GET DISCONNECTED

link to screen info from Ubuntu's help site.

screen -S python

DOWNLOAD PYTHON

cd $HOME

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a4.tgz

UNPACK, BUILD, AND INSTALL PYTHON FROM SOURCE

tar -zxvf Python-3.7.0a4.tgz

cd Python-3.7.0a4

Get Coffee number 1

./configure

Get Coffee number 2

WE HAVE 4 PROCESSORS, SO LET'S USE 4 THREADS! RASPBERRY PI POWER!!

make -j4

Get Coffee number 3

sudo make install

You should be well caffenated by now, or drunk if you switched out coffee for shots of whiskey. Some of the modules will fail, some will not. Meh, the whiskey helps your google searches for fixes.

cd

CLEAN UP YOUR MESS

sudo rm -Rfv ./Python-3.7.0a4

cd

CHECK OUT YOUR HANDY WORK

python3 --version

output: pi@raspberrypi:~ $ python3 --version Python 3.7.0a4

MAY AS WELL UPGRADE PIP AND SETUPTOOLS AS THEY WILL YELL AT YOU ANYWAY.

sudo pip3 install -U pip

sudo pip3 install -U setuptools