Reputation: 1193
I've been trying to use this yml file to create an environment (I created the yml):
name: testenv
channels:
- esri
- scitools
- obspy
- conda-forge
- defaults
dependencies:
- appnope=0.1.0=py36_0
- libgfortran=3.0.0=0
- pip=9.0.1=py36_0
- python=3.6.2=0
- wheel=0.30.0=py_1
- pip:
- ipython-genutils==0.2.0
- jupyter-client==5.1.0
- jupyter-console==5.1.0
- jupyter-core==4.3.0
- prompt-toolkit==1.0.15
however it always fails with the following error message:
Using Anaconda API: https://api.anaconda.org
Solving environment: failed
ResolvePackageNotFound:
- wheel==0.30.0=py_1
- appnope==0.1.0=py36_0
Is it searching the wrong channels for it? I can find these packages if I simply install them in the base conda install. Thanks for your help.
Upvotes: 12
Views: 43597
Reputation: 61
To expand on the answer of @msamon. I had the same error and their answer solved 90% of the problem. There did however remain a number of packages that could still not be resolved. This is because some Windows installations/packages will have Windows-specific libraries that will of course never be available on Linux.
The solution is to remove the versioning values, run the Conda environment install again, and then completely delete from the .yml any remaining packages flagged as not present. Letting Conda handle any resulting missing dependencies and/or refactoring your code to use different libraries that do have distributions on the Linux channels.
I verified this approach on a transfer of environment using a .yml from a Windows 10 machine to a Linux remote machine with a Python3.6 install, via Conda4.9.2.
Upvotes: 4
Reputation: 73588
Sometimes found that pip
does a better job than anaconda
in package versioning. So after "activating" that anaconda environment, I do
while read req; do conda install --yes $req || pip install $req; done < ./requirements.txt
this way first I use anaconda, if that fails I try pip
. Please note that i suggest "activating" that anaconda environment and then running the above command else it would pollute the global pip pool.
Upvotes: 2
Reputation: 325
Had this same issue. Solved it by removing both the build versions AND package version (except for necessary package versions such as python=3.6.2
and any others.) The end yml file would look like this in order to be fully cross-platform:
name: testenv
channels:
- esri
- scitools
- obspy
- conda-forge
- defaults
dependencies:
- appnope
- libgfortran
- pip
- python=3.6.2
- wheel
- pip:
- ipython-genutils
- jupyter-client==5.1.0
- jupyter-console
- jupyter-core
- prompt-toolkit
Upvotes: 11
Reputation: 1193
The problem is that the Anaconda isn't lying to me. Those packages don't exist in the linux channels however they do exist in the OSX channels. So it is a platform specific problem.
Upvotes: 20