16

I have tried to install new package in conda for windows using the following command:

conda install -c conda-forge python-pdfkit

but got the following error:

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.

I have tried the following workarounds but no use, still getting the same error:

Workaround 1:

$conda create --name myenv
$conda activate myenv

Workaround 2:

conda config --set ssl_verify false
Rajesh Potnuru
  • 161
  • 1
  • 1
  • 5

5 Answers5

5

As stated by a Conda maintainer in https://github.com/conda/conda/issues/8051#issuecomment-1549451621 their official position is that they know the old solver is slow and that is why they put effort in allowing the libmamba solver to be used in Conda.

To install:

conda install -n base conda-libmamba-solver

at which point you are free to use it once, e.g.:

conda install tensorflow --solver=libmamba

or set as default solver:

conda config --set solver libmamba

It usually solves in seconds.

For more installation info see: https://conda.github.io/conda-libmamba-solver/getting-started/

  • 1
    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/34769143) – doneforaiur Aug 03 '23 at 07:44
  • 2
    @doneforaiur edited to include content from the links in the answer, so even though links will break, people who stumble on this will know what to look for online – Daniele Gentili Aug 03 '23 at 10:50
4

I have had a similar issue before and since I don't see your code I can't specify exactly what the solution is. All I know is that while installing conda package the following issues might occur:

  1. The package you are trying to install is not available in the conda-forge channel. In this case, you may need to try installing the package from a different channel, or you may need to specify a different channel in the conda install command.
  2. The package you are trying to install is not compatible with your current version of conda or with the other packages you have installed. In this case, you may need to try updating your version of conda or try installing a different version of the package.
  3. There is a problem with your conda configuration or with the conda environment you are using. In this case, you may need to try creating a new conda environment and installing the package there, or you may need to try re-installing conda itself.

If you are still having trouble installing the package after trying the above methods, Please give me more details about your specific situation, such as the version of conda you are using and the other packages you have installed. This will help me know more about your issue to be able to offer more specific suggestions.

Hope this will help somehow.

0

Really I faced the same problem and it takes me all day to solve it. So my final idea was to create a new environment to download specific packages that the environment need, So I run code.

Code:

conda create --name tf tensorflow-gpu
S.B
  • 13,077
  • 10
  • 22
  • 49
  • conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 <-- no work for me –  Mar 22 '23 at 03:11
0

i had the same problem trying to install matplotlib.

In my case, I had a channel_priority = strict.

I changed it to flexible with

conda config --set channel_priority flexible

hope it helps!

-5

Don't use conda install for the basic installation of your base environment, if you have the same habit like me to install all the frequently-used packages to one base environment. Use only pip for this environment.

conda install will check out all the inconsistency of an environment, and this check is detailed to the "channel name" and "label hash", even your package's version is supported forthe installation, but it was installed from a different channel or different label, the installation will not be continued. Furthermore, this check is "recursive", it will keep on check which packages caused the inconsistency of the packages that were found inconsistency of the installing package...

- defaults/osx-64::pep8==1.7.1=py38hecd8cb5_1

Look at this line, this refers that this package "pep8" of version "1.7.1" of channel "defaults/osx-64" of label "py38hecd8cb5_1"is inconsistency. Maybe the version "1.7.1" is Ok but the label "py38hecd8cb5_1" is not Ok that means you must download this package from exactly the same label with the installing package.

So actually, Conda encourages users to create multiple different environments, each with a small number of packages installed, and to use them for a single task scenario.

ShuangSong
  • 305
  • 5
  • 10
  • I did not downvote this, but yes, don't do that. I would say never use pip in base and use pip in envs if and only if there is no other way. The main reason is it will create quite hard to debug conflicts down the road – melMass May 16 '23 at 15:09
  • 2
    Don't use pip in a conda environment unless absolutely nothing else will work. Seriously. Its *very* much the wrong way to go. pip has a completely different dependency resolution tree and your going to get stuff overwriting each other all over the place. Further it completely breaks reproducability because your environment wont be accurately resolved via conda environment --from-history – Shayne Jun 15 '23 at 07:34