datitran / object_detector_app

Real-Time Object Recognition App with Tensorflow and OpenCV
https://medium.com/towards-data-science/building-a-real-time-object-recognition-app-with-tensorflow-and-opencv-b7a2b4ebdc32
MIT License
1.3k stars 748 forks source link

environment.yml ResolvePackageNotFound #41

Open sousocheat opened 6 years ago

sousocheat commented 6 years ago

Windows 10 64bit

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

ResolvePackageNotFound:
  - freetype 2.5.5 2
Aki1987 commented 6 years ago

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

Best, Thu

sousocheat commented 6 years ago

Thank you. It worked.

EniasCailliau commented 6 years ago

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 commented 6 years ago

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

ResolvePackageNotFound:

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 commented 6 years ago

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:

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:

vinisalazar commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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]

themataleao commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda env create -f etc solved it for me

ghost commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda env create -f etc solved it for me

It works lke a charm!

Can you give some explanation for this solution.

Raghav-Dhir commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda env create -f etc solved it for me

Beautiful How does it works though?

shuaiadai commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda env create -f etc solved it for me

works for me thanks

pranavnijampurkar33 commented 4 years ago

Worked but how?

rinkesh-ahuja commented 4 years ago

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:

brunakatiele commented 4 years ago

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 commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda 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 commented 4 years ago

running this firstconda config --set restore_free_channel true and thenconda 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 commented 3 years ago

running this firstconda config --set restore_free_channel true and thenconda 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 commented 3 years ago

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 commented 3 years ago

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.

jingpengw commented 3 years ago

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

genecell commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

didn't work for me.sad

mistune commented 1 year ago

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 commented 9 months ago

running this firstconda config --set restore_free_channel true and thenconda env create -f etc solved it for me

This didn't work for me Experiencing ResolvePackageNotFound: