object_detector_app icon indicating copy to clipboard operation
object_detector_app copied to clipboard

environment.yml ResolvePackageNotFound

Open sousocheat opened this issue 7 years ago • 35 comments

Windows 10 64bit

Using Anaconda API: https://api.anaconda.org
Fetching package metadata .................

ResolvePackageNotFound:
  - freetype 2.5.5 2

sousocheat avatar Jan 13 '18 03:01 sousocheat

ResolvePackageNotFound describe all packages not installed yet. That you need to move ResolvePackageNotFound to below pip: sentence looks like: image

Best, Thu

Aki1987 avatar Jan 16 '18 01:01 Aki1987

Thank you. It worked.

sousocheat avatar Jan 16 '18 01:01 sousocheat

The whole concept of using yml files is to simplify environment installation on other computers. Why does the conda env export command generate a file that only works on the originating host?

EniasCailliau avatar May 09 '18 07:05 EniasCailliau

Ubuntu Using Anaconda API: https://api.anaconda.org Solving environment: failed

ResolvePackageNotFound:

  • opencv3==3.0.0=py35_0
  • tbb==4.3_20141023=0

Though I've placed these two requirements under pip section in .yml file im getting the same error. Can you help me out?

Yp17ra avatar Jun 07 '18 06:06 Yp17ra

It seems that menpo tbb is for osx-64 only, and jlaura::opencv3=3.0.0 is not available for some reason. By slightly omitting the detail in environment.yml:

  • tbb==4.3_20141023=0 to tbb
  • jlaura::opencv3==3.0.0=py35_0 to opencv3

The initial error was resolved, but I faced another error like this:

UnsatisfiableError: The following specifications were found to be in conflict:

  • libtiff==4.0.6=3 -> jpeg=9
  • qt==5.6.2=2 -> jpeg=8

There will be more elaborate ways to handle this error, but I took a simple detour like this:

  • libtiff==4.0.6=3 to libtiff
  • qt==5.6.2=2 to qt

HS-YN avatar Jul 26 '18 10:07 HS-YN

The whole concept of using yml files is to simplify environment installation on other computers. Why does the conda env export command generate a file that only works on the originating host?

This is still haunting me.

vinisalazar avatar Jan 25 '19 14:01 vinisalazar

@Aki1987 that worked!! thank you.

ResolvePackageNotFound describe all packages not installed yet. That you need to move ResolvePackageNotFound to below pip: sentence looks like: image

Best, Thu

Vinod-Koli avatar Mar 07 '19 08:03 Vinod-Koli

I had the same problem. It is frustrating, because precisely the point of anaconda is to manage this automatically.

I didn't have any pip packages in my environment.yml, all were packages installed by conda. How come conda cannot reproduce and environment I created with conda?

The solution I found was to remove all the packages that were installed as dependencies and just leave the packages I myself had installed with conda install packagename. Still, basemap was failing. I removed basemap and it worked.

Then I installed basemap with conda install basemap.

Finally, I did a _conda env export, which again was full of dependencies (not only the primary I want). I copied the line corresponding to basemap and I manually edited my environment.yml adding this line there. So, now in environment.yml I only have tha packages I would have installed with conda install when I first created the environment.

This way, except basemap, the package I import in my python scripts will have the same version they had in the environment. Then, the dependencies are those that conda choses.

bitic avatar Jul 18 '19 13:07 bitic

Later I had the same problem importing another environment from an environment.yml.

I followed a better procedure than in my previous comment.

  1. I removed from environment.yml the 4 packages that were failing (could not be installed by conda).
  2. I installed the environment. Now it worked.
  3. From those 4 packages that failed, only one was "primary" (a package I import on my scripts), so I installed it manually with conda install. This installed this package and the other 3 that were failing, but with new versions.
  4. I exported the new environment to environment.yml.

Now the environment is almost identical, except for 4 packages whose version changed.

bitic avatar Jul 18 '19 13:07 bitic

Just here to commiserate - environment.yml from an Ubuntu project wouldn't install on on OS X.

Added a --no-build flag to my export reduced me from loads of packages not found to just 4. I removed those and everything was basically fine.[credit]

irockafe avatar Sep 10 '19 22:09 irockafe

Try to make the import of the .yml file directly in the Anaconda Navigator, within the Environments section. It worked for me. I used Anaconda3 version 4.7.12. image

willhama avatar Oct 23 '19 17:10 willhama

A solution is to create your env without the yml file. Then update it through conda env update --file environment.yml It worked for me

DavidJulienMillet avatar Nov 18 '19 22:11 DavidJulienMillet

@DavidJulienMillet but how do you create an env without a yml file? I tried 'conda env create' but it just looks for an environment.yml file in the current directory that doesnt exist.

bush avatar Dec 23 '19 01:12 bush

@DavidJulienMillet but how do you create an env without a yml file? I tried 'conda env create' but it just looks for an environment.yml file in the current directory that doesnt exist.

You can use conda create -n test_env python=3.6.3 anaconda.

Though the env update solution didn't work out for me. It is giving the same ResolvePackageNotFound

ayushjain1144 avatar Dec 23 '19 20:12 ayushjain1144

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

DanielDoe avatar Feb 19 '20 21:02 DanielDoe

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

It works lke a charm!

Can you give some explanation for this solution.

ghost avatar Apr 03 '20 10:04 ghost

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

Beautiful How does it works though?

Raghav-Dhir avatar Apr 12 '20 19:04 Raghav-Dhir

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

works for me thanks

shuaiadai avatar Apr 12 '20 23:04 shuaiadai

Worked but how?

pranavnijampurkar33 avatar Apr 19 '20 11:04 pranavnijampurkar33

I tried to create the environment using .yml file but this is the error I got. How to download these specific packages? I tried installing them via Anaconda navigator but it didn't resolve the issue.

ResolvePackageNotFound:

  • libcxx=4.0.1
  • libedit=3.1
  • glib=2.53.6
  • libffi=3.2.1
  • gettext=0.19.8.1
  • libcxxabi=4.0.1
  • ptyprocess=0.5.2
  • readline=7.0
  • terminado=0.6
  • libgfortran=3.0.1
  • ncurses=6.0
  • appnope=0.1.0
  • dbus=1.10.22

rinkesh-ahuja avatar Jun 19 '20 23:06 rinkesh-ahuja

I had the same problem. It is frustrating, because precisely the point of anaconda is to manage this automatically.

I didn't have any pip packages in my environment.yml, all were packages installed by conda. How come conda cannot reproduce and environment I created with conda?

The solution I found was to remove all the packages that were installed as dependencies and just leave the packages I myself had installed with conda install packagename. Still, basemap was failing. I removed basemap and it worked.

Then I installed basemap with conda install basemap.

Finally, I did a _conda env export, which again was full of dependencies (not only the primary I want). I copied the line corresponding to basemap and I manually edited my environment.yml adding this line there. So, now in environment.yml I only have tha packages I would have installed with conda install when I first created the environment.

This way, except basemap, the package I import in my python scripts will have the same version they had in the environment. Then, the dependencies are those that conda choses.

worked for me... many thanks!

brunakatiele avatar Jun 29 '20 15:06 brunakatiele

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

It works lke a charm!

Can you give some explanation for this solution.

I recently a problem with ResolvePackageNotFound and conda config --set restore_free_channel true fixed it for me as well. It seems that Anaconda removed the free channel due to 1) peformance reasons and 2) Issues with old packages that can result in strange and hard-to-debug errors.

sources: https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/free-channel.html https://www.anaconda.com/blog/why-we-removed-the-free-channel-in-conda-4-7

olavrongved avatar Jul 03 '20 10:07 olavrongved

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

this didnt work for me. am working on macOS does this have sth to do with operating system?

realshijy avatar Jul 09 '20 16:07 realshijy

running this first conda config --set restore_free_channel true and then conda env create -f etc solved it for me

this didnt work for me. am working on macOS does this have sth to do with operating system?

This is a longshot but try brew install miniconda2 . FWIW on my mac with miniconda2 these commands work fine:

conda env export > environment.yml
### (edit environment.yml and change name of env in first line)
conda env create -f environment.yml

But I copy environment.yml to a 64-bint linux mint box, that also has miniconda2, and it always fails:

conda config --set restore_free_channel true
conda env create -f environment.yml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - tk==8.6.8=ha441bb4_0
  - freetype==2.9.1=hb4e5f40_0
... (every single package in the env)

Wonder why it fails spectacularly on linux? Perhaps since I'm having to create a py2 env with some really old obsolete pkgs? (But why does it work fine on macos?) I'll update this post if I figure it out.

=== UPDATE === Ok, it seems it is very hard if not impossible to make a single env.yml that is cross-platform. See https://stackoverflow.com/questions/55554431/conda-fails-to-create-environment-from-yml and https://stackoverflow.com/questions/55554431/conda-fails-to-create-environment-from-yml for example.For me, even with every trick at above sites, including using the sed trick to create a new clean env.yml, I could not get the env that works find in osx to transfer to linux.

So, It looks like you need a different env.yml for each platform. Or use just one env.yml but in a docker as detailed here https://repo2docker.readthedocs.io/en/latest/howto/export_environment.html

porteusconf avatar Aug 07 '20 01:08 porteusconf

I had similar issues when trying to reproduce an environment created on MacOS on an Ubuntu EC2 instance. Using the anaconda guidance for creating cross-platform .yml files that exclude platform specific dependencies solved the issue for me: conda env export --from-history. After creating my environment.yml file in this manner, I was able to successfully recreate the environment where before I ran into numerous ResolvePackageNotFound errors.

indielyt avatar Nov 11 '20 17:11 indielyt

Adding channels to my environment.yml file fixed things for me.

I noticed the environment described by conda env export; lists "channels" at the top. Adding some of those allowed things like pytorch and langdetect to be resolved properly.

# environment.yml
name: hello
channels:
  - pytorch
  - conda-forge
  - default
dependencies:
  - python>=3.8
  - pytorch>=1.71
  - langdetect
  - pandas=1.0.1
  - numpy=1.18.1

I just added the "channels" portion.

aakropotkin avatar Jan 02 '21 20:01 aakropotkin

It turns out that the yaml file was generated in Mac OS, and it is not directly usable in Linux.

xiuliren avatar Jan 06 '21 14:01 xiuliren

Ubuntu Using Anaconda API: https://api.anaconda.org Solving environment: failed

ResolvePackageNotFound:

  • opencv3==3.0.0=py35_0
  • tbb==4.3_20141023=0

Though I've placed these two requirements under pip section in .yml file im getting the same error. Can you help me out?

Placing the requirements in the pip also did not work for me. I deleted the packages reported by ResolvePackageNotFound in the .yml file, and then Conda is able to install other packages and create the environment. My error is: ResolvePackageNotFound: - binutils_impl_linux-64==2.34=h53a641e_0 - ld_impl_linux-64==2.34=h53a641e_0

genecell avatar Jan 19 '21 12:01 genecell

ResolvePackageNotFound describe all packages not installed yet. That you need to move ResolvePackageNotFound to below pip: sentence looks like: image

Before you do this, make sure the package you care about is also in the PIP registry otherwise you are wasting your time.

The solution that worked for me was this:

  1. Look up the package causing the issue (For me it was one package)
  2. If it is a Conda specific package, make sure have the channel it is registered on in your environment.yml
  3. Update your channels accordingly and see if this resolves your issue

Conclusion

For some reason and somehow Conda installed a package NOT listed in the channels I used in my source Conda environment. Seems like a bug but unsure.

jesshart avatar May 10 '21 19:05 jesshart

Just my 2 cents, my issue was with ta-lib which requires the conda-forge channel, but the export does not include this info so the yaml file is unusable.

name: mql5
channels:
  - defaults
dependencies:
  - pip
  - ta-lib
  - python=3
  - graphviz
  - pywin32
prefix: C:\Users\worth\anaconda3\envs\mql5

worthy7 avatar Nov 10 '21 03:11 worthy7