Installation of Python Version from Source

Aus Wiki
Wechseln zu: Navigation, Suche

Download Python – Download the Python 3.9 source code archive from its official website. alternatively use below wget command to download Python source code.

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

Extract Archive – Next, extract the download archive file using the tar command. If required change your directory before extract.

tar xzf Python-3.9.4.tgz 

Compile Python Source – Switch to the extracted directory and configure the source code with enabling optimizations.

cd Python-3.9.4 
./configure --enable-optimizations 

Install Python 3.9 – Finally, run the make command to complete the Python installation. Here altinstall option is to install Python separately than default versions.

make altinstall 

Check version

python3.9 -V 
pip3.9 -V