Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why (or why not) Add Anaconda to path?

I have found a partial answer in this question: Adding Anaconda to Path or not

But I still don't fully understand. I have had a lot of installation issues when switching from a normal installation Python to Anaconda, requiring me to completely re-install Windows... So i want to get this right now.

What happens internally when I Add Anaconda (or python for that matter) to the PATH? I plan on working with seperate conda environments for different python versions, what could go wrong if I add Anaconda to path in the installation? And what is the difference between doing it in the installation or doing it later through the command prompt? Will it affect my ability to integrate anaconda with PyCharm?

like image 508
Psychotechnopath Avatar asked Oct 05 '18 11:10

Psychotechnopath


People also ask

Where should I put Anaconda?

The default install location for Anaconda is: (Linux): /home/<your_username>/Anaconda3. (Windows): C:\Users\<your_username>\Anaconda3. (Mac): /Users/<your_username>/Anaconda3.

Should I install Anaconda in C or D drive?

To make Anaconda easily accessible, place it in a directory (where you have write permissions) that is as high up on the drive as possible. For instance, on my system, I have the D: drive reserved for applications, so I use D:\Anaconda3 as my Anaconda install directory.

Should I add Python to PATH?

Adding Python to PATH makes it possible for you to run (use) Python from your command prompt (also known as command-line or cmd). This lets you access the Python shell from your command prompt.

What is the benefit of installing Anaconda?

Benefits of Using Python Anaconda It has more than 1500 Python/R data science packages. Anaconda simplifies package management and deployment. It has tools to easily collect data from sources using machine learning and AI. It creates an environment that is easily manageable for deploying any project.


1 Answers

PATH is an environment variable that is a list of locations where executable programs lie (see also the wikipedia page.

Whenever you are in your command line and try to execute some program, for example regedit, then the cmd does not magically know that you mean C:\Windows\regedit.exe. Instead, it searches all locations in your PATH for an executable named regedit and finds it in C:\Windows which is one of the standard parts of PATH in Windows.

That is also, why messing with the PATH can be dangerous if you don't know what you are doing, because it might lead to things not working anymore if, for example you delete parts of the path or add custom directories to it.

That being said, you should now have an idea what happens when you "Add anaconda to path". It simply means, that Anaconda adds the directory where its executables lie to the PATH, hence making it findable when, for example you type conda in your cmd.

That being said, adding Anaconda to PATH is something that is convenient, beacuse the commands can always be found automatically and they will also be found by other programs scanning your PATH for a python executable.

At the same time it is not neccessary. When you use e.g. pycharm, then you can specify the path to the interpreter inside of pycharm. it does not neccessarily need to be present in your PATH.

Note:

I personally have it on my PATH because I am too lazy to open an Anaconda prompt each time I need it in a cmd and I do not see the harm in it if you understand the consequences and its my only python installation anyway.

Also Helpful:

On windows, you can use the where command to find out from where commands are laoded. For example:

where regedit

gives

 C:\Windows\regedit.exe

This can be esspecially helpful when trying to debug PATH issues

like image 172
FlyingTeller Avatar answered Sep 20 '22 15:09

FlyingTeller