1

I thought that this would simply be done by running pip install within the environment (after source activate). But in my case, pip install affects ALL my environments.

For example, I am trying to install an older version of torch only in env1, but if I run pip install torch==1.1.0 after source activate env1 all my environments have torch version 1.1.0.

I also tried manually running pip as described in this answer but it didn't work.

How can I fix that?

Versions

  • Anaconda 3, 2019.07
  • Python 3.7
Simon
  • 5,070
  • 5
  • 33
  • 59
  • Is something in your PATH making pip executable not the one for the environment? What if you use `python -m pip install` – OneCricketeer Jan 27 '21 at 01:03
  • @OneCricketeer Same results, all torch versions are updated/downgraded (depending on which I install). `$PATH` outputs `/private/home/username/.conda/envs/ride/bin:/public/apps/anaconda3/2019.07/condabin:/usr/local/cuda/bin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory` – Simon Jan 27 '21 at 01:10
  • I also tried manually running `pip` as described in [this answer](https://stackoverflow.com/questions/41060382/using-pip-to-install-packages-to-anaconda-environment) but it didn't work. – Simon Jan 27 '21 at 01:11
  • Wow, that's really strange. If this were happening to me, I'd want to figure out what is actually changing on my filesystem when I install a package. You ought to be able to do this and see that the new files are going to one of your Python installs and not a venv. If you do see files within a venv directory changing, and that affects anything else, something is super wacko. – CryptoFool Jan 27 '21 at 01:18
  • I'd say remove Anaconda from your path, then install pyenv and use it for version management and just virtualenv itself for environments unless you explicitly need conda – OneCricketeer Jan 27 '21 at 15:01

0 Answers0