Sourcing Anaconda activates a script compared to adding the Anaconda bin directory to PATH

I would like to switch to Anaconda Python as my default Python environment.

To use Anaconda on a Python system, I looked at the following two options:

  • Adding the Anaconda bin path to my bash variable PATH(in mine .bashrc) so that Anaconda binaries take precedence over those located elsewhere on the system.
  • Anaconda search activates a script in my bash shell (again, automatically adding it to mine .bashrc).

As a person who is relatively new to Anaconda Python, I'm not sure which of the two approaches is generally considered the best. So I was wondering if there is general guidance in this regard?

As far as I can see, the main difference between the two approaches lies in the fact that activate the script specifies a number of additional shell environment variables, such as: CONDA_PREFIX, PS1, CONDA_PS1_BACKUPand CONDA_DEFAULT_ENV.

+4
source share
1 answer

Having experimented with both approaches over the past couple of weeks, I settled on the first option: adding the Anaconda binary path to the variable PATHin user files .bashrc.

I found the benefits of this method:

  • , Anaconda script .bashrc, , source deactivate, , Anaconda. , Anaconda PATH, deactivate script Ansible PATH.
  • Anaconda script , , Python, , .
  • Anaconda PATH, source activate, "" Anaconda. ( , - , .)
0

Source: https://habr.com/ru/post/1688004/


All Articles