Reputation: 1187
Why is anaconda choking on common packages, in creating an envionment from a YML file? Anaconda COMES with these packages pre-installed in root (or so I thought?)
YML file:
---
name: rasterenv
channels:
- conda-forge
dependencies:
- gdal>=2.2.3
- rasterio
- cython
- jupyter
- matplotlib
- numpy
- pyproj
- shapely
- rasterio
- pandas
- geopandas
- os
- matplotlib
- seaborn
- fiona
- OSMnx
- pip:
- pygeotools
- pygeoprocessing
Trying to build file with: conda env create -f path/to/file
If I create an enviornment with JUST uncommon packages like rasterio, it appears to work. BUT, I want an environment with all! What gives here?
Error is:
ResolvePackageNotFound:
- os
If I remove os
from the list, the error then becomes:
ResolvePackageNotFound:
- matplotlib
Upvotes: 0
Views: 451
Reputation: 1410
As @sinoroc pointed out in the comments, os
is part of Python standard library and should not be listed as a dependency. (When you do define it as a dependency, Python is going to look for a package called os
on all available repositories [PyPI or anaconda.org in this case] and won't find it.)
You can see which packages are part of the standard library by checking the docs here: https://docs.python.org/3/library/ (Also there have been a few questions on SO on how to find out if a particular package is part of the std lib, e.g. How to check if a module/library/package is part of the python standard library?) When you create a new environment the packages from the std lib are the only ones which are available by default. Anything else needs to be installed.
Additionally there are two packages in your yaml file that are listed twice (rasterio
and matplotlib
) which makes me think that you manually created that file. You can generate a conda environment file by activating an environment and running conda env export > environment.yml
which will create a file called environment.yml
with all required dependencies.
Upvotes: 1