Oct-16-2017, 03:12 AM
i would like to setup as many installed versions of python under linux as possible without chroots, containers or virtual machines. anyone know how (even if only for a specific distro)?
sudo apt install python3.5 python3.6
. The second should not (edited) replace the first or already installed version.make install
do make altinstall
Quote:i would like to setup as many installed versions of pythonYou are not limited to whatever that linux distro's repo has available. You can just download every python version you want from python.org and compile them from source. In theory you can have every single version ever built if you really wanted to.
./configure makeand there will be a python executable named
python
for that version downloaded in that directory. And you just repeat the process with every version you want. And to run that version ./python
if your in that directory, otherwise the path to that directory. mint@mint ~ $ pyenv install 3.6.2 Downloading Python-3.6.2.tar.xz... -> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz Installing Python-3.6.2... Installed Python-3.6.2 to /home/mint/.pyenv/versions/3.6.2 # Make python and pip default to 3.6.2 or what version want to use mint@mint ~ $ pyenv global 3.6.2 # Check what's available mint@mint ~ $ pyenv install --list # here will list all version available from 2 to 3,Anaconda,PyPy...ect. # Install the version you desire mint@mint ~ $ pyenv install anaconda-x.x.x # If just want test out Anaconda is a shell session. pyenv shell anaconda-x.x.x # It's safe don't mess with OS python # Can always go back to system default mint@mint ~ $ pyenv local system mint@mint ~ $ python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> mint@mint ~ $ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>>