How to Install Multiple Python Versions on Unihiker in the Simplest Way? For example , Python 3.10.- DFRobot Forum

SourceURL:  

Method 1: Build python 3.11 from source.  

Note: You can choose whichever python version you want, just find the correct fpt link from www.python.org/ftp/python/  

  

1. Update your system:  

sudo apt-get update  

  

2. Install the required dependencies to be able to build Python 3.11 from the source:  

sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev tk-dev  

  

3. Make a directory for python 3.11:  

mkdir python311  

  

4. Navigate to the directory:  

cd python311  

  

5. Then download Python 3.11 from the official Python release page. While on this page, download the Python 3.11 Gzippeed tarball. Alternatively, get the download link and pull it with Wget as shown:  

wget www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz  

  

6. With the tarball downloaded, extract it as below:  

tar -xf Python-3.11.*.tgz  

  

7. Navigate into the extracted directory and run the configure command to check if the required dependencies are available.  

cd Python-3.11.*/  

sudo ./configure –enable-optimizations  

  

8. When the check is complete, build Python 3.11 from the source as below:  

make -j 2  

  

9. When make is complete, proceed and install Python 3.11:  

sudo make altinstall  

   

Note: The altinstall flag is used to maintain the default Python binary path in /usr/bin/python.  

  

10. Verify your installation:  

python3.11 –version  

  

It should output: Python 3.11.04  

$ python3.11 –version  

Python 3.11.4  

   

Installation successful.  

Read more here: Source link