0

When I run which command in the terminal, I sometimes get multiples return values. Eg:

python est ~/miniconda3/envs/mikado2/bin/python
python est ~/miniconda3/bin/python
python est /usr/bin/python

So my question is: how to manage these installations ? Which one is the one by default and how to change it ?

More generally, when I use a conda environment, I thought I would have access in priority the one installed in the conda environment, but it does seem to be so straight-forward. How do you handle conda tools versions when you have both these tools installed locally and with conda ?

Ian Kemp
  • 28,293
  • 19
  • 112
  • 138
Natha
  • 364
  • 1
  • 3
  • 20

1 Answers1

0

If you set up Conda using conda init, then you should never have two Conda Pythons on the PATH simultaneously. Since conda activate prepends to PATH, any system-level installations should be superseded.

I have seen others have issues when different Python installations have identical major.minor versions (e.g., 3.6 + 3.6), and experience a leakage of packages from the system-level Python into the Conda Python. I've tested this with the Mac OS X (it has Python 2.7.16 at /usr/bin/python) and a matching env, and find that with the env activated, the Conda Python takes priority and I cannot load any packages that are only present in the system-level Python. Checking import sys; print(sys.path) can also reveal whether the Python is staying isolated.

I suspect those experiencing leakage issues have installed separate system- or user-level installs of Python that may have included setting PYTHONPATH, which definitely leads to leakage and typically should be avoided.

merv
  • 67,214
  • 13
  • 180
  • 245