How to install Python 3.7 on Raspberry Pi


            

This short guide explains how to install Python version 3.7.0 on a Raspberry Pi running Raspbian.
First, get rid of old versions:

apt list –installed
sudo apt-get autoremove python*

Ensure system is up to date:

sudo apt-get update

Install the dependencies needed for building the distribution:

  • build-essential
  • tk-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
sudo apt-get install -y build-essential tk-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

Get the python src distribution:

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3.7.0.tar.xz
cd Python-3.7.0

Configure and compile (this might take an awful lot of time, depdning on your Raspberry’s performances):

./configure –prefix=/usr/local/opt/python-3.7.0
make -j 4

Install:

sudo make altinstall

Make aliases and default version:

sudo ln -s /usr/local/opt/python-3.7.0/bin/pydoc3.7 /usr/bin/pydoc3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7 /usr/bin/python3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7m /usr/bin/python3.7m
sudo ln -s /usr/local/opt/python-3.7.0/bin/pyvenv-3.7 /usr/bin/pyvenv-3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/pip3.7 /usr/bin/pip3.7
alias python=’/usr/bin/python3.7′
alias python3=’/usr/bin/python3.7′
ls /usr/bin/python*
cd ..
sudo rm -r Python-3.7.0
rm Python-3.7.0.tar.xz
. ~/.bashrc

Check proper installation:

python -V

AD8307 RF Power Meter

My first finished KiCad project is a prototype of a RF Power meter with input attenuation built around an Analog Device AD8307. An excellent tutorial about log amps can be read in March 1999 edition of Analog Dialogue. KiCad PCB: And the 3D rendering of the same PCB: The next step will be PCB ordering, […]

Altera Qsys, NIOS II and FPGA fun

One very interesting feature of Altera FPGAs is that almost any system can be created in its next-generation system integration tool Qsys using a standard library of reusable IP blocks. The system interconnect fabric is automatically generated by Qsys and binds the blocks together. The system interconnect manages dynamic bus with matching, interrupt priorities, arbitration […]

Leave a Reply

Your email address will not be published. Required fields are marked *