Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

environment.yml ResolvePackageNotFound #41

Open
sousocheat opened this issue Jan 13, 2018 · 35 comments
Open

environment.yml ResolvePackageNotFound #41

sousocheat opened this issue Jan 13, 2018 · 35 comments

Comments

@sousocheat
Copy link

Windows 10 64bit

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

ResolvePackageNotFound:
  - freetype 2.5.5 2
@Aki1987
Copy link

Aki1987 commented Jan 16, 2018

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

Best, Thu

@sousocheat
Copy link
Author

Thank you. It worked.

@EniasCailliau
Copy link

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?

@Yp17ra
Copy link

Yp17ra commented Jun 7, 2018

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?

@HS-YN
Copy link

HS-YN commented Jul 26, 2018

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

@vinisalazar
Copy link

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.

@Vinod-Koli
Copy link

@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

@bitic
Copy link

bitic commented Jul 18, 2019

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
Copy link

bitic commented Jul 18, 2019

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.

@irockafe
Copy link

irockafe commented Sep 10, 2019

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]

@willhama
Copy link

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

@DavidJulienMillet
Copy link

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

@bush
Copy link

bush commented Dec 23, 2019

@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.

@ayushjain1144
Copy link

ayushjain1144 commented Dec 23, 2019

@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

@DanielDoe
Copy link

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

@ghost
Copy link

ghost commented Apr 3, 2020

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.

@Raghav-Dhir
Copy link

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?

@shuaiadai
Copy link

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

@pranavnijampurkar33
Copy link

Worked but how?

@rinkesh-ahuja
Copy link

rinkesh-ahuja commented Jun 19, 2020

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

@brunakatiele
Copy link

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!

@olavrongved
Copy link

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

@realshijy
Copy link

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?

@porteusconf
Copy link

porteusconf commented Aug 7, 2020

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

@indielyt
Copy link

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.

@aakropotkin
Copy link

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.

@xiuliren
Copy link

xiuliren commented Jan 6, 2021

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

@genecell
Copy link

genecell commented Jan 19, 2021

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

@jesshart
Copy link

jesshart commented May 10, 2021

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.

@worthy7
Copy link

worthy7 commented Nov 10, 2021

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

@chase-coffee
Copy link

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

Did you happen to find a solution for this or have a workaround?

@safal312
Copy link

I am facing this issue currently. The thing is I tried importing the environment on multiple computers to see if it was an issue with my system. The environment imports perfectly on macOS but for windows, it just doesn't work at all. Does anyone know anything about this?

@kayky233
Copy link

kayky233 commented Jun 9, 2022

didn't work for me.sad

@mistune
Copy link

mistune commented Sep 7, 2022

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.

This fixed the pytorch dependency for me.

@LeahN67
Copy link

LeahN67 commented Oct 24, 2023

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

This didn't work for me
Experiencing ResolvePackageNotFound:

  • libgfortran=5.0.0 error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests