Install Python from source
in this case, aim to install python version 3.7.1 on debian 9 (stretch).
1 2 3 4 5 6 7 8 |
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev cd /opt/ wget -c https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz tar zxvf Python-3.7.1.tgz cd Python-3.7.1/ ./configure --enable-optimizations make -j 8 make altinstall |
command to run it:
if you want to add a module, just reconfigure and reinstall.
example:
1 2 3 |
./configure --enable-optimizations --enable-loadable-sqlite-extensions make make altinstall |