Score:0

Difference between Anaconda prompt and command prompt

in flag
r21

I recently swapped over from Windows to Ubuntu.

In Windows when I did any sort of coding I used the anaconda prompt which was separate to the command prompt to run any commands relevant to python.

However when switching over to Ubuntu, there is only one terminal onto which I have downloaded Anaconda. It now shows the same format as anaconda prompt in windows i.e. beginning with (base).

I was wondering what the difference is between this and a simple Windows command prompt as it now loads (base) by default, but I am not sure if I can still run normal non-anaconda-related commands in this terminal or I somehow have to get rid of this (base) prompt.

Score:0
cn flag
Ray

Under Ubuntu (Linux), when you use Anaconda, you are just changing the search path for programs. For example, type: env | grep ^PATH and note what it says.

Now, if you have created an environment called foo and then activated it by typing conda activate foo, then you will now see the (foo) prompt.

After you do that, type env | grep ^PATH again. And you will see that the location of the "foo" environment has been placed earlier in your PATH. Programs are sought a directory at a time, starting from the front of the PATH.

If you're in the "foo" environment, your terminal will search for programs in "foo", then the base environment (i.e., the environment which is the parent to all other environments), and then the system.

By default, when you log in, the "base" environment activates. That is what you're seeing. If you want to disable it, create a file called ~/.condarc (or edit it if there's a file there already) and add this to it:

auto_activate_base: false

Log out and log back in and the "base" environment will no longer activate automatically. If you have a program called "bar" installed within the system, within the "base" environment, and the "foo" environment, it's possible that they could be 3 different versions. It's always useful to use the which command to see where the program you are running is located in. i.e., type which bar.

And yes, you can run "normal non-Anaconda" commands. It will search for programs based on your PATH setting. If you have activated the "foo" environment and you want to run a program explicitly in the system, then you can also just provide the exact location. i.e., /bin/bar. Anaconda doesn't "hide" the system from you -- it just changes the priority when looking for programs.

(I can't answer your question about comparing against Windows because I have never used it with Anaconda.)

Hope this helps!

r21 avatar
in flag
r21
Hi Ray. Thank you for responding so quickly, I think I have a better understanding now based on what you said. So essentially I should still be able to carry out any unrelated commands to Anaconda but still whilst in the (base) environment. Thanks again!
cn flag
Ray
@sr21 You're welcome! And yes, you're correct. If you think my answer is ok, then feel free to "Accept" it . Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.