Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 1.61 KB

INSTALLING_PYTHON_DEPENDENCIES.md

File metadata and controls

70 lines (46 loc) · 1.61 KB

Installing Python Dependencies on Linux servers

Installing Python 3.9.5

On debian and derivatives, the python3 package only installs Python up to version 3.7, which doesn't include support for the typings used in this project

It might therefore be necessary to manually compile Python 3.9.5

  1. Run the following command to setup the build tools

    sudo apt install wget software-properties-common build-essential libnss3-dev zlib1g-dev libgdbm-dev libncurses5-dev libssl-dev libffi-dev libreadline-dev libsqlite3-dev libbz2-dev 
  2. Download Python 3.9.5

    wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz
  3. Extract the contents of the compressed file, and move into the folder

    tar xvf Python-3.9.5.tgz
    cd Python-3.9.5/
  4. Configure

    ./configure --prefix=/usr/local --enable-ipv6 --enable-loadable-sqlite-extensions --enable-optimizations --enable-shared
  5. Install

    sudo make altinstall
  6. Verify with the following command

    python3.9 -V

Aliasing to python3

Additionally, you might want to remove any old references to python3, and alias this to the new installation

sudo apt remove python3

Once this is complete, add the following line to the end of ~/.bashrc

alias python3='python3.9'

If Python complains that it's library module can not be found, run the following command

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

Other dependencies

sudo apt install python-pip python3-venv