Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda.yaml file: what does channel means and why there needs pip if dependencies already exists?

Tags:

conda

I am studying MLFlow, which uses conda to help set environments and dependencies. In following conda.yaml file /1/, I have three questions:

  1. What does channel means? Why there needs anaconda? What is default channel?

  2. In dependencies section, there is pip, pip is package management tool. If there is dependencies key word, why there is again a need for pip? Does pip install dependencies' dependencies.

  3. name: flower_classifier, does means environment name is flower-classifier?

/1/

name: flower_classifier
channels:
  - defaults
  - anaconda
dependencies:
  - python==3.6
  - numpy==1.14.2
  - keras==2.2.4
  - pandas
  - pip:
    - tensorflow-gpu==1.10.0
    - mlflow
    - click==6.7
    - scikit-learn
    - pillow
like image 603
user84592 Avatar asked Apr 08 '19 07:04

user84592


1 Answers

1 Channels

This refers to where Conda, the environment management tool, is going to look to find the declared dependencies. Currently, the defaults channel will search all URLs under the https://repo.anaconda.com/pkgs/ directory. The anaconda channel is a subset of this that only includes pkgs/main, pkgs/free and pkgs/pro. It is unnecessary to include both these channels since defaults covers them both. See the Anaconda documentation on repositories.

2 Why pip?

Not all Python packages are available as Conda packages. Some might only available through PyPI, or may be released there first. By including pip in the dependencies, that Python-specific package manager will be included. Listing packages below pip in the hierarchy, indicates that pip should be used to install those packages.

3 Environment Name

Yes, the environment name will be flower_classifier by default. However, the --name | -n flag can be used to override this if you happen to not be that into flowers.

conda env create -f conda.yaml -n my_env
like image 87
merv Avatar answered Sep 30 '22 09:09

merv