conda fails to create environment from yml

No, PyPI is not the issue. Instead, it fails because the YAML includes platform-specific build constraints, but you are transferring across platforms. Specifically, examining the build numbers on the failed packages (e.g., six=py36h0e22d5e_1), I can see that they correspond to packages from the osx-64 platform, but you are trying to install on a linux-64 platform, hence the build constraints are unresolvable.

Omit Build Info

The simplest solution to this is to omit the build info from the environment definition export.

conda env export -n py36 -f py36.yml --no-builds

There can still be issues if some of the packages are not available on linux-64 through Conda. If this is the case, you may need to find other channels (or check PyPI), switch versions, or remove the dependency altogether. Most of the packages look standard though.

Not so important, but you can safely remove cvxgrp from your channels. That channel only serves an outdated version of cvxopt and only for osx-64.

Explicit Specifications Only

Another, even more loosely defined option, is to output only what Conda refers to as explicit specifications. These indicate only those requirements that have been explicitly requested by the user. This includes packages, but also captures any version constraints, etc., that were provided by the user at some point.

conda env export -n py36 -f py36.yml --from-history

The advantage here is that any platform-specific dependencies will be ignored.

Leave a Comment