Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having two python installed (same version)

I installed python 3.5, and then I installed anaconda package containing python 3.5. I think python 3.5 is now installed twice at different path. Is there something I need to do in this case? Or should I uninstall one of them?

enter image description here

like image 573
YJZ Avatar asked Jan 18 '26 19:01

YJZ


2 Answers

It is OK to have both Python 3.5 on your Computer, but it is better to delete one of them to avoid confusion in the future.

If you still insist on having two same Python, please check at first your environment path whether it is the right Version for you. If you use some IDEs like eclipse or pycharm, you can easily choose the right python interpreter in property.

If you want to keep two seperate Python,you can easily use Python virtue environments http://docs.python-guide.org/en/latest/dev/virtualenvs/

like image 74
xirururu Avatar answered Jan 20 '26 09:01

xirururu


It is fine to have both of them as long as you knew what version is invoked when you run your scripts. As stated by others, check your PATH system variable.

In the past I also had Python 2.7 and Python 3.5 installed together. What I did was I renamed my python.exe file in my Python 3.5 installation into python3.exe. This way, when I type "python3" in the command line, it would invoke the Python 3.5 version, and Python 2.7 if only "python" is entered.

Example for your case:

C:\Python35\python.exe ---> C:\Python35\python.exe (retain name)
C:\Anaconda3\python.exe ---> C:\Anaconda3\python_anaconda.exe (rename)

So that command line execution will be,

C:\Users\Hello>python helloworld.py ---> uses the version in C:\Python35
C:\Users\Hello>python_anaconda helloworld.py ---> uses the version in C:\Anaconda3

Depending on your IDE, they can also do this for you conveniently.

like image 22
jowabels Avatar answered Jan 20 '26 10:01

jowabels