Skip to content

Instantly share code, notes, and snippets.

@InfinityCliff
Last active January 31, 2024 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InfinityCliff/7198719a375304572fcdf4dc1080ecc8 to your computer and use it in GitHub Desktop.
Save InfinityCliff/7198719a375304572fcdf4dc1080ecc8 to your computer and use it in GitHub Desktop.
Raspberry pi - Python 3 latest version install

Update Raspberry pi to latest version of Python3

Original Answer: https://raspberrypi.stackexchange.com/questions/54365/how-to-download-and-install-python-3-5-in-raspbian

GET DEPENDANCIES:

$ sudo apt-get install build-essential libc6-dev
$ sudo apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev
$ sudo apt-get install libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
$ sudo apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev

DOWNLOAD:

$ cd $HOME
$ wget https://www.python.org/ftp/python/*ver*/Python-*ver*.tgz
    # it is faster to download on PC and transfer to pi with FileZilla
$ tar -zxvf Python-*ver*.tgz

COMPILE:

$ cd Python-*ver*
$ ./configure       # 3 min 13 s
# We have 4 processors, so let's use 4 threads
$ make -j4          # 8 min 29 s
$ sudo make install # ~ 4 min
$ sudo reboot

TEST:

$ cd
$ python3 --version
    # output: "Python *ver*"
$ pip3 list
    # output: 
    # pip (8.1.1)
    # setuptools (20.10.1)
    # You are using pip version 8.1.1, however version 8.1.2 is available.
    # You should consider upgrading via the 'pip install --upgrade pip' command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment