Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it ok to install both Python 2.7 and 3.5?

Supposedly Python 2.7 is included native to OSX 10.8 and above (if I remember correctly), but I recently installed Python 3.5 to use for projects while I work through UDacity. Lo and behold, the UDacity courses seem to use 2.7 - wups! So instead of trying to uninstall 3.5 (this procedure seemed to scary for neophytes such as myself), I simply installed 2.7 in addition to the recently installed 3.5 and just run the 2.7 IDLE and Shell. Is this ok, or will I run into problems down the road?

like image 703
jarombra Avatar asked Sep 27 '15 19:09

jarombra


People also ask

Can I have both python 2 and 3?

We can have both Python 2 and Python 3 installed on any Windows or Linux device. We can either create different environments on different IDEs to use the versions separately or use the following ways to run them using the command prompt.

Can you have 2 version of python?

Multiple Python versions: Different installations of Python on the same machine, 2.7 and 3.4 for example. Virtual environments: isolated independent environments that can have both a specific version of Python and of any project-specific packages installed within them, without affecting any other projects.

Can I install both python 2 and 3 anaconda?

Yes, It should be alright to have both versions installed.

Does pip install for both python 2 and 3?

In this article, learn how to install pip on Ubuntu 18.04. Note: If you are using Python in a virtual environment created with pyvenv or virtualenv, then pip is available regardless of the version of Python in use. This also applies to Python 2.7. 9 or newer (Python series 2) and Python 3.4 or later (Python series 3).


2 Answers

I have installed two versions, 2.7, 3.4 and I do not have any problem by now. 3.4 I am using for my work project in eclipse environment, 2.7 for udacity course, like You ;).

like image 169
Pavol Liška Avatar answered Oct 19 '22 11:10

Pavol Liška


As long as you keep your installation folders organized, you should have no issues having both on your computer, besides one thing. The path environment variable for python will determine which version is used by default, so I would say stick to one version, or make sure to make your programs as backwards compatible as possible. I have run into this issue on Windows, since I installed Python 3.4 before 2.7, and therefore to run older code, I have to manually select the python executable. In terms of libraries, I believe that for each python version, the libraries are completely separate, so you should be good there.

like image 35
Andrew Lalis Avatar answered Oct 19 '22 13:10

Andrew Lalis