Install Spesific Python version
I try this on linux environtment
If you want to install specific python version & tips how to put the installation in specific directory
cd ~
mkdir tmp
cd tmp
wget https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tgz
tar zxvf Python-3.10.1.tgz
cd Python-3.10.1
# if you want to install on specific directory, use --prefix
mkdir $HOME/opt/python-3.10.1
./configure --prefix=$HOME/opt/python-3.10.1
make
make install
the installation will stored in $HOME/opt/python-3.10.1
$HOME/opt/python-3.10.1/bin/python --version
$HOME/opt/python-3.10.1/bin/pip --version
$HOME/opt/python-3.10.1/bin/pip install <some_module>
You can combined it with python venv
$HOME/opt/python-3.10.1/bin/python -m venv /path/to/venv3.10.1
source /path/to/venv3.10.1/bin/activate
Now you can use that python version, you can install some python module using pip
in that python version