102

I am using anaconda as below:

(base) C:\Users\xxx>conda info

     active environment : base
    active env location : C:\Users\xxx\Documents\ANACONDA
            shell level : 1
       user config file : C:\Users\xxx\.condarc
 populated config files : C:\Users\xxx\.condarc
          conda version : 4.7.11
    conda-build version : 3.18.9
         python version : 3.6.9.final.0
       virtual packages :
       base environment : C:\Users\xxx\Documents\ANACONDA  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\xxx\Documents\ANACONDA\pkgs
                          C:\Users\xxx\.conda\pkgs
                          C:\Users\xxx\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\xxx\Documents\ANACONDA\envs
                          C:\Users\xxx\.conda\envs
                          C:\Users\xxx\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.11 requests/2.22.0 CPython/3.6.9 Windows/10 Windows/10.0.16299
          administrator : False
             netrc file : None
           offline mode : False

Now I have 2 issues that stop my work. 1) I cannot use conda install for any package. It will give me the error in solving environment list this:

failed with initial frozen solve. Retrying with flexible solve.

then it will fail again and give message like this:

Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.

Even after the checking for incompatible packages, it didn't give me the solution.

2) When I want to upgrade or downgrade conda by the command:

conda update -n base conda

or

conda install conda = 4.6.11

It will give me errors again in the solving environment, and I think this is related to the first issue.

Now I cannot use conda for anything, please advise and thank you!

J.D
  • 1,885
  • 4
  • 11
  • 19
  • 8
    If anyone coming from Google has this issue and also uses conda-forge, try `conda config --set channel_priority flexible`. The source of the issue for some users (including myself) was `conda config --set channel_priority strict`. – dcwaters Apr 13 '22 at 09:05
  • 2
    "This can take several minutes." I LOLed. This process can run for *hours* and still not return anything. What I don't understand is that it already happen from a fresh anaconda install, without changing anything. – Eric Duminil Jan 26 '23 at 14:31

11 Answers11

97

I ran into the same problem and I couldn't find a solution, but I did find a workaround. If you create an env and activate that env and then do the install, it seems to work just fine. If you don't need a lot of libraries I would try that.

Commands are:

  1. Create env
conda create --name myenv
  1. Activate the env
conda activate myenv
linog
  • 5,786
  • 3
  • 14
  • 28
SKiD
  • 1,094
  • 7
  • 4
  • Although this is a workaround, but it seems the most feasible way to solve this problem. After having another env, the conda install works again and this time I only choose conda install as much as possible and carefully. – J.D Sep 20 '19 at 02:28
  • 1
    For folks like me who start creating a virtual environment using python, the environment has to be created using conda and not anything else. – Abhyudai Nov 10 '19 at 22:49
  • 1
    Same problem here and a lot of users posting the same question on their Github page. Creating a new env seems to work fine. Otherwise it takes forever to solve the environment. – frankliuao Nov 16 '20 at 01:21
  • 1
    Is there really no other way? Creating a new environment is too large for my smaller drive so I can only use the base environment – B.Quaink Jan 05 '21 at 09:31
  • 3
    I ran into this problem in a completely new environment I had just created, so apparently there's more to the problem than just a corrupted environment. – Grant Petty Jan 29 '21 at 22:20
  • conda install -c anaconda python=3.8 I created an new environment and activated it then install python 3.8 – Golden Lion Aug 18 '21 at 17:54
  • `conda info --envs` to view your environments, `conda activate` to select one – Michael Boles Nov 15 '21 at 04:51
58

I started running in to this problem when one package suggested following modifications before installation

conda config --set channel_priority true

so I just reverted it and voila error's gone

conda config --set channel_priority false
exan
  • 3,236
  • 5
  • 24
  • 38
  • 3
    Thanks a lot, this worked for me on conda 4.9.2. There was no need to downgrade conda to 4.6 – sherminator35 Nov 13 '20 at 20:46
  • 3
    Now **channel_priority** has different values: 'strict', 'flexible', and 'disabled'. Try `conda config --describe channel_priority` to get a description of these new values. `true` and `false` are still accepted but only act as aliases for flexible and disabled, while strict is a completely a new value that, if it finds the package you're trying to install into a high-priority-channel, completely ignores other channels disregarding the version they're providing. – Masso Apr 28 '21 at 00:59
  • 1
    this worked for me as well with conda 4.10.3 on macos. – channa ly Sep 17 '21 at 02:48
  • 1
    this works for me too. I remembered setting it to Strict due to some package recommendation. Then forgotten to set it back. Thanks for the help! – Denz Choe May 12 '22 at 03:27
  • 1
    Works for conda 4.13 – GoingMyWay Aug 08 '22 at 10:47
25

I solved a similar problem by doing the following:

conda update --all --yes
Rosario Scavo
  • 466
  • 4
  • 7
  • 1
    Solved my problem to install `pyarrow`. Thanks. – igorkf Aug 05 '21 at 15:01
  • 1
    Solved my issue too, with contextlib2 – Yishai E Sep 29 '21 at 09:31
  • Hmm, but still it becomes a sort of infinite process and it downloads packages once again. – Snowball Apr 28 '22 at 08:53
  • Didn't work for me. conda 4.12.0, trying to install snowflake-connector-python. – Perceptron Jun 25 '22 at 05:44
  • 1
    Solved my problem with pathos. Conda forge website told me to execute `conda config --set channel_priority strict` and after this the problems started. `conda update --all --yes` reinstalled and updates some packages from `conda-forge` and installation of `pathos` was then successful (and everything works). – PKua Nov 05 '22 at 11:18
5

You may downgrade to an older version of conda 4.6.14 and then install your packages.

conda config --set allow_conda_downgrades true
conda install conda=4.6.14
Abhyudai
  • 826
  • 7
  • 16
4

If your conda version is greater than or equal to 4.8, you may see that error.

(base) [localhost ~]$ conda --version
conda 4.8.2
(base) [localhost ~]$ conda install -c anaconda requests-kerberos
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

Downgrade your conda if possible using the following commands

conda config --set allow_conda_downgrades true
conda install conda=4.6.14

Then create your virtual environment:

conda create --name myenv_conda

Then activate your myenv_conda

conda activate myenv_conda

Now try to install packages using conda -c install anaconda

eg: conda install -c conda requests-kerberos

output:
(myenv_conda) [localhost ~]$ conda install -c anaconda requests-kerberos
Collecting package metadata: done
Solving environment: done
....
....
....
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Guru
  • 69
  • 5
1

https://stackoverflow.com/a/61117831/7802476 helped me. Creating a new environment using the accepted answer didn't get my jupyter notebook to recognize the installed opencv. I could only import cv2 when I was in the environment on my terminal.

The fix was to use pip instead of conda, pip install opencv-python

Prox
  • 639
  • 10
  • 15
1

I run into same problem while installing geopandas. The issue was gone after I upgraded to a newer version of Anaconda using:

conda update --prefix C:\apps\anaconda3 anaconda

Note: you'll have to modify the path C:\apps\anaconda3 pointing to your own installation directory.

Strangely, I did download Anaconda from the official homepage just a few hours ago and thought I had the newest version...

Thomas
  • 8,357
  • 15
  • 45
  • 81
0

I had same problem but I solved because of SKİD.

After you create new env, You can run one of the codes in this link.

https://anaconda.org/rdkit/rdkit

teksoy
  • 7
  • 4
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30979570) – Kaz Feb 07 '22 at 11:40
0

I've generally had good results with conda and pip, but learned over time that environments really can get broken by unusual combinations of packages, and just starting a new env from scratch is often the only way forward. In my case it was tensorflow-gpu that wouldn't install from conda-forge, into an env I'd already been using for some weeks. The list of packages cited as being incompatible was in the dozens. I tried all the things listed on this page, but in the end I just hammered out a new env. Since I was deducing what packages I needed to install in the new env by running my program and installing one package at each error (ie instead of being methodical about listing my former env), along the way I reproduced this frozen solve thing several times. Each time it happened, I shuffled that conda package back to the initial conda create command and started again. Eventually my program ran in the new env, with tensorflow-gpu imported, and the root cause was revealed as conda installs which occur after pip installs. It wasn't anything to do with conda version or conda config.

A specific note for anyone using opencv-python, I ended up needing to install qt via conda, before attempting to install opencv-python via pip. That was a tricky one because it's a runtime error, and on stack overflow many of the solutions refer to various qt lib requirements which aren't part of python/conda and which I already had.

A further specific note. Some pip installs will roll back a version of a related package, thus breaking other conda-installed packages. In my case the example was a package called peakutils rolling back numpy, which then broke a from numpy import ma in scale.py module in the matplotlib package. My head is still spinning.

J B
  • 348
  • 1
  • 6
-1

Create a new environment if your are not superuser, after that activate environment to install packages

Rochan
  • 1,412
  • 1
  • 14
  • 17
  • It does not help, even the original author mentioned that such a method is problematic and it would be better to put channel_priority as false – Snowball Apr 28 '22 at 08:46
-3

Recommend to upgrade conda latest version.

conda install --quiet --yes conda=4.7.11 
python -m pip install --upgrade pip==19.2.2
Asclepius
  • 57,944
  • 17
  • 167
  • 143
Taewon
  • 133
  • 2
  • 2