If you create a python environment in conda
with --prefix
flag and activate it, post-activation the environment is shown by its entire path. This could be a very long path and hence the conda-documentation suggests a fix as follows.
conda config --set env_prompt '({name})'
The problem is when you
deactivate
this environment, then you don't go back to the default behavior. Even if you activate the base environment, it would show you the entire path of the base environment instead of just(base)
.
For instance, I installed the conda environment under path Users/username/Documents/GitHub/test_flask/.env
on the C-drive (Windows 10).
BEFORE
applying the command (conda config --set env_prompt '({name})'
), post activation it looks like this:
(C:\Users\username\Documents\GitHub\test_flask\.env) C:\Users\username\Documents\GitHub\test_flask>
And AFTER
applying the command (conda config --set env_prompt '({name})'
), if I activate the environment, it looks like this:
(.env) C:\Users\username\Documents\GitHub\test_flask>
Great!
But now if I deactivate this environment and/or activate my base
environment, I get this:
'(Anaconda3)'C:\Users\username\Documents\GitHub\test_flask>
However, I would like to get back:
'(base)'C:\Users\username\Documents\GitHub\test_flask>
So, how to fix this?