Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda: Install specific packages from specific channels using environment.yml

does anyone know how to construct an Anaconda environment.yml file so that it installs specific packages from specific channels?

Something like this:

dependencies:   - numpy   - pandas   - package-A from channel Z   - package-B from channel Y 

All I could find is that you can specify channels using the channels: command. But apparently it then grabs the packages from the first channel its available on - but I need some packages from very specific channels (but it exists on multiple ones in different "versions").

like image 448
Alex Avatar asked Dec 19 '17 12:12

Alex


People also ask

How do I install packages in anaconda environment?

Go to Environments tab just below the Home tab and from there we can check what all packages are installed and what is not. It is very easy to install any package through anaconda navigator, simply search the required package, select package and click on apply to install it.

How do I install multiple packages on anaconda?

The recommended way to install multiple packages is to create a . yml file and feed conda this. You can specify the version number for each package as well. To specify different channel for each package in this environment.

How do you create a conda environment in a specific path?

Create a new conda environment from a list of specified packages. To use the created environment, use 'conda activate envname' to look in that directory first. This command requires either the -n NAME or -p PREFIX option.


1 Answers

I saw something like

dependencies: - chanelname::modulename=X.Y.Z 

Update It now implemented: https://github.com/conda/conda/issues/7202

Old answer Be carefull since it doesn't seemed to be implemented. A channel is, by design, a "space" where depencies are robust. So removing this might break dependencies.

like image 58
Thomas PEDOT Avatar answered Oct 21 '22 03:10

Thomas PEDOT