Pyhton

pegasis

Member
May 17, 2014
186
0
76
Hello I have questions on Python 2.7 and 3.5

what is the best way to run both versions on the same machine?

IS Anaconda just a package management software or does it come with a specific version of pyhton?

I see an anaconda version for Python 2.7 and a version for 3.5?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
You get python 3 and python 2 in most standard distributions. For example I am running ubuntu 15.04..

$ which python
/usr/bin/python

$ python
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

$ which python3
/usr/bin/python3

$ python3
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.

If you look in /usr/bin you will see that 'python' and 'python2' are symlinks to 'python2.7', and 'python3' is a symlink to 'python3.4'.

So the key point is that the two versions live side by side just fine, keeping their system packages in separate locations.

That said, as Staples points out the best way to keep things clean and separate is to use virtualenv and virtualenvwrapper. Those tools will make it possible to install packages into a "virtual" python system so you don't crud up your global install.