1

I have installed an virtual environment with conda and activate it with the following command lines

conda create -n test1 python=2 anaconda

source activate test1

or

conda activate test1

and when I activate it and run conda env list, it shows me that this environment is activated

enter image description here

When I check the execution paths, it seems every thing is ok:

enter image description here

but problem is that I could not see any (namyenv) indicator at the start of the command line in terminal and it seams its do not work very well:

enter image description here

How can I add this envname at the beginning of the code line?

merv
  • 67,214
  • 13
  • 180
  • 245
kobi
  • 13
  • 4
  • 2
    This functionality concerns the PS1 of the prompt. It might be worth reading up on this (e.g., [some Unix SE questions](https://unix.stackexchange.com/search?q=%5bprompt%5d%20PS1)). Conda has `changeps1` and `env_prompt` settings that control if and how `PS1` is changed, respectively (see `conda config --describe changeps1 env_prompt`). Unfortunately, behavior can be highly dependent on shell (bash, zsh) and terminal, so you'd need to add details on that to get a more specific answer. – merv Jul 21 '22 at 19:03
  • 2
    Thank you so much yes that was ok .I commanded `conda config --set changeps1 True` and fixed – kobi Jul 21 '22 at 19:50
  • 1
    Worked for me! Pandas does not set it to show the activated environment in PS1. `conda config --set changeps1 True` – Quan Truong Sep 05 '22 at 19:15

1 Answers1

0

Adding an answer for posterity to allow for flagging for duplicates to point to this question.

Using the following command spell seems to work:

conda config --set changeps1 True
rayryeng
  • 102,964
  • 22
  • 184
  • 193