python-guide icon indicating copy to clipboard operation
python-guide copied to clipboard

Installation and switching of multiple python versions

Open asfaltboy opened this issue 8 years ago • 4 comments

I saw that there is little mention in the guide of how to install and handle multiple python versions. I wrote this short guide gist on using PyEnv for myself and my friends, and was wondering if this is something that has place in the guide.

If so, please let me know how it should be modified/improved prior to integration to the guide.

asfaltboy avatar Jul 10 '16 11:07 asfaltboy

You can build a branch, and pull a Request to the Author.

pengyuchu avatar Jul 11 '16 06:07 pengyuchu

I suppose that above @asfaltboy can be accomplished more easily by using virtualenv. It provides a standalone container or environment in which you can run any python application without making conflicts with the system. refer to this for more details and instructions on askubuntu thread

I suppose there is no need of a new section

arpit1997 avatar Sep 24 '16 14:09 arpit1997

@arpit1997 does virtualenv allow you to install and switch to another python version? E.g install python 2.7 and 3.5 alongside each other and switch easily between multiple versions?

While it's true one can download multiple versions of python on a system and then initiate a virtualenv using a given python version (rather than the default), the process is not "touch-and-go" on most systems. It often requires the knowledge of the make altinstall option and others (e.g --prefix=/my/custom/path) to achieve this. See for example digitalocean's tutorial for centos.

The only caveat I have with my own suggestion is that pyenv may not be a canonical tool, and not everyone may agree with it's "philosophy". However this guide is already pretty opinionated, and using pyenv is in my opinion the easiest way to achieve multi-python installation.

asfaltboy avatar Sep 25 '16 06:09 asfaltboy

You can build a branch as per number of python version and pull a Request to the Author so it allows you to switching of multiple python versions. : )

heyhimansh avatar Mar 27 '21 18:03 heyhimansh