Peter Leopold
Peter Leopold

Reputation: 145

how to create a custom python environment from yml file *with* downloads of missing packages

I am trying to build a python 3.5 environment that supports an old hddm library. Standard approaches fail due to my/anaconda's apparent inability in ignore (or downgrade) the 10.1 cuda library in favor of an older one that works with hddm.

There is a yml file available that describes a successful environment. But the advertised command

conda env create -file hddm_py35.yml

fails with an error listing all of the packages "not found." Here are the errors.

(base) PS C:\Users\Peter\anaconda3_Sep2020> conda env create --file .\hddm_py35.yml Collecting package metadata (repodata.json): done Solving environment: failed

ResolvePackageNotFound:

(base) PS C:\Users\Peter\anaconda3_Sep2020>

The failure occurred within seconds. I get the feeling that conda didn't even try to look for these packages!?!?

  1. Am I supposed to download these packages, put them somewhere, and then tell conda to find them on my hard drive?

  2. Is there a flag that tells conda to do its usually find-and-load for all "missing" packages -- but only in the environment I'm describing? In my base environment (3.8) I don't wish to downgrade.

  3. Should make a new 3.5 environment and then work through the list one-by-one and uninstall/remove/downgrade each package by hand?

  4. Meta question: This must be a FAQ, and yet I'm not able to google for the answer. That usually means googling for "conda install environment from yaml file" doesn't contain the appropriate vocabulary for, well, trying to induce conda to install an environment from a yaml file. What question should I have asked?

Upvotes: 0

Views: 849

Answers (1)

Peter Leopold
Peter Leopold

Reputation: 145

1) Am I supposed to download these packages, put them somewhere, and then 
tell conda to find them on my hard drive?

Not necessary. But searching for the versions on anaconda.org helps identify channels for one-by-one manual download.

2) Is there a flag that tells conda to do its usually find-and-load for all 
"missing" packages -- but only in the environment I'm describing? In my base 
environment (3.8) I don't wish to downgrade.

There is no evidence that conda will automatically download files listed in a yaml file that are missing in the present environment.

3) Should make a new 3.5 environment and then work through the list one-by-
one and uninstall/remove/downgrade each package by hand?

Yes.

4) Meta question: This must be a FAQ, and yet I'm not able to google for the 
answer. That usually means googling for "conda install environment from yaml 
file" doesn't contain the appropriate vocabulary for, well, trying to induce 
conda to install an environment from a yaml file. What question should I have 
asked?

There is no evidence that yaml files are anything other than lists of version of packages in an environment. They cannot be used to make new environments (unless all of the components are already present in the host environment, maybe) so their value is largely annotative. Evidently.


For the case of making an environment for hddm in 2020, well, don't try. Cuda support will work against you. There is a hddm host at https://colab.research.google.com/ that is properly configured (without cuda disruption) so that you can use it to kick tires, etc. Getting hddm to work in any other context probably requires dedicated hardware so that the cuda driver can be manipulated for this application only and not break any other applications in the process.

Upvotes: 0

Related Questions