0

I've tried to remove packages using conda uninstall. The command runs for a long time, takes up a large amount of memory (but doesn't run out I believe) and then quits with no indication of having completed the 'Solving environment' step. When I check, the package is still there. For example:

(base) pm@pm:~/Software/anaconda3/bin$ conda uninstall -n base pytorch
Collecting package metadata (repodata.json): done
Solving environment: - (base) pm@pm:~/Software/anaconda3/bin$ conda list -n base -f pytorch
# packages in environment at /home/pm/Software/anaconda3:
#
# Name                    Version                   Build  Channel
pytorch                   1.7.1           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch

I've also tried remove, which does exactly the same thing. Suggestions welcome!

FlyingTeller
  • 17,638
  • 3
  • 38
  • 53
JasonK
  • 113
  • 7
  • I just carefully tracked memory usage during the 15 or so minutes that 'conda uninstall' runs. At first memory decreases slowly, but toward the end, it's using up a gigabyte of memory every few seconds. I started with 14.5GB available and, before conda uninstall suddenly quits, I had 360MB left. So it looks like an out of memory error. I guess the question is whether I will have to reinstall anaconda or if there are other things I can try first. – JasonK Mar 03 '22 at 17:32
  • Conda, by the way, is working fine with the exception of uninstall. I can install new packages, clean, update existing (including conda and anaconda). But I've tried to uninstall three packages and it just quits evidently because it is out of memory. – JasonK Mar 03 '22 at 18:21
  • I just wiped Anaconda off my system with instructions from the link below. Fortunately, I didn't have a lot of specialized environments. https://stackoverflow.com/questions/42182706/how-to-uninstall-anaconda-completely-from-macos/42182997#42182997 – JasonK Mar 03 '22 at 22:33

1 Answers1

1

If you're here because you're trying to install a pre or beta package that isn't available via conda, I was able to do an upgrade via pip.

I had installed h3-py via conda, which installed v3.7.

$ conda install h3-py

...

The following NEW packages will be INSTALLED:

  h3-py              conda-forge/linux-64::h3-py-3.7.4-py311ha362b79_1 None

They then released v4, which drastically changed the API and I wanted to update. Anaconda was hanging and eventually killed on an uninstall or remove:

$ conda uninstall h3-py                                  
Collecting package metadata (repodata.json): \ Killed

But pip saved the day (the --update will just get the latest, the --pre was for me to get the pre-release):

$ pip install h3 --upgrade --pre

...

Successfully built h3
Installing collected packages: h3
  Attempting uninstall: h3
    Found existing installation: h3 3.7.4
    Uninstalling h3-3.7.4:
      Successfully uninstalled h3-3.7.4
Successfully installed h3-4.0.0b1

Still, would be great if conda uninstall worked.

wwwslinger
  • 936
  • 8
  • 14
  • Do make sure you are using the environment pip binary and not the global or base (`which pip` will show this) – wwwslinger Nov 22 '22 at 04:57
  • Will doing pip installs in a conda setup mean that conda will lose track of what was installed? Anyway, glad to know that --upgrade and --pre are available. – JasonK Dec 29 '22 at 00:42
  • @JasonK pip installs in a conda environment are pretty common, especially since not everything is available through conda. You do need to be sure you're using the conda env's pip, and then everything from pip shows up via `conda env export`. – wwwslinger Jan 02 '23 at 23:12