PackagesNotFoundError on conda

Viewed 1813

I am trying to recreate a conda environment. From one environment I executed conda list --export > req.txt
and now I am trying to recreate a new environment with the same packages using
conda create --name <env_name> --file req.txt

I get the following error:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - idna==2.10=pypi_0
  - multivar-hypergeom==0.0.1=pypi_0
  - pygments==2.6.1=pypi_0
  - pexpect==4.8.0=pypi_0
  - pynacl==1.4.0=pypi_0
  - jedi==0.17.0=pypi_0
  - attrs==20.1.0=pypi_0
  - importlib-metadata==1.7.0=pypi_0
  - sh==1.14.1=pypi_0
  - toolz==0.11.1=pypi_0
  - fsspec==0.8.4=pypi_0
  - cycler==0.10.0=pypi_0
  - joblib==1.0.0=pypi_0
  - dask==2.30.0=pypi_0
  - packaging==20.4=pypi_0
  - colorama==0.4.3=pypi_0
  - pandas==1.1.0=pypi_0
  - paramiko==2.7.1=pypi_0
  - pluggy==0.13.1=pypi_0
  - iniconfig==1.0.1=pypi_0
  - urllib3==1.26.3=pypi_0
  - bcrypt==3.1.7=pypi_0
  - backcall==0.1.0=pypi_0
  - requests==2.25.1=pypi_0
  - ipython==7.14.0=pypi_0
  - networkx==2.4=pypi_0
  - parso==0.7.0=pypi_0
  - partd==1.1.0=pypi_0
  - ipdb==0.13.2=pypi_0
  - ptyprocess==0.6.0=pypi_0
  - pytest==6.0.1=pypi_0
  - cryptography==3.0=pypi_0
  - pytz==2020.1=pypi_0
  - chardet==4.0.0=pypi_0
  - matplotlib==3.2.2=pypi_0
  - scikit-learn==0.24.0=pypi_0
  - scipy==1.5.2=pypi_0
  - markupsafe==1.1.1=pypi_0
  - decorator==4.4.2=pypi_0
  - six==1.14.0=pypi_0
  - ipython-genutils==0.2.0=pypi_0
  - pyyaml==5.3.1=pypi_0
  - locket==0.2.0=pypi_0
  - threadpoolctl==2.1.0=pypi_0
  - traitlets==4.3.3=pypi_0
  - tqdm==4.53.0=pypi_0
  - toml==0.10.1=pypi_0
  - cffi==1.14.2=pypi_0
  - zipp==3.1.0=pypi_0
  - pickleshare==0.7.5=pypi_0
  - gitdb==4.0.5=pypi_0
  - numpy==1.18.4=pypi_0
  - pyparsing==2.4.7=pypi_0
  - smmap==3.0.4=pypi_0
  - pycparser==2.20=pypi_0
  - prompt-toolkit==3.0.5=pypi_0
  - bio==0.3.0=pypi_0
  - pysftp==0.2.9=pypi_0
  - tzlocal==2.1=pypi_0
  - wcwidth==0.1.9=pypi_0
  - gitpython==3.1.8=pypi_0
  - py==1.9.0=pypi_0
  - python-dateutil==2.8.1=pypi_0
  - jinja2==2.11.2=pypi_0
  - more-itertools==8.5.0=pypi_0
  - sklearn==0.0=pypi_0
  - rpy2==3.3.5=pypi_0
  - kiwisolver==1.2.0=pypi_0
  - utility==1.0=pypi_0
  - termcolor==1.1.0=pypi_0
  - biopython==1.78=pypi_0
  - docopt==0.6.2=pypi_0

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

at some other stackoverflow question regarding this issue an accepted answer was to execute
conda config --append channels conda-forge
but after I did, I get the same error.

conda version is 4.8.2

1 Answers

The pypi in the build imply that these packages were all installed from PyPI, presumably using pip. The conda list --export does not capture pip-installed packages in a form that allows for recreating the environment. Instead, try dumping to a YAML, which will discriminate such packages and make it possible to recreate the environment:

conda env export > environment.yaml
conda env create -n <env_name> -f environment.yaml
Related