'UnsatisfiableError glibc and cudatoolkit

conda install  -c anaconda -c conda-forge -c nvidia cudatoolkit=11 tensorflow-gpu=2

I want to install cudatoolkit=11 and tensorflow-gpu=2, but conda gave me the following error message

UnsatisfiableError: The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.31=0
  - cudatoolkit=11 -> __glibc[version='>=2.17,<3.0.a0']

Your installed version is: 2.31

If I run

conda install  -c anaconda -c conda-forge -c nvidia cudatoolkit=11

conda can successfully install cudatoolkit=11.

Since glibc is a system feature, why installing cudatoolkit by itself is ok?

Why isn't glic 2.31 in range >=2.17,<3.0.a0?



Solution 1:[1]

I am providing answer as I could not find outright reason and solution.
If you are installing from conda-forge channel in conda base env this problem is very likely to occur due to c-runtime difference between conda and conda-forge.
To solve this , create virtual-env make conda-forge channel as first and stick to it(Strict) for installing packages, I don't see any harm in sticking to conda-forge , and have found many experienced people suggesting same (stick to conda-forge channel).

Solution 2:[2]

Updating anaconda to the newest version solved my problem.

Try conda update conda?

Solution 3:[3]

Install fvcore and iopath with conda install -c fvcore -c iopath -c conda-forge fvcore iopath. Then try again.

Solution 4:[4]

Let the environment solver choose the correct versions for cuda and tensorflow.

assuming you are setting up a new conda environment:

conda create -n <NAME> cudatoolkit tensorflow-gpu <packages> -c <channels>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Deep Saurabh
Solution 2 LeoX
Solution 3 Michael
Solution 4