Conda 常用命令

List all of your packages in the active environment:

conda list

To list all of your packages installed into a non-active environment named snowflakes:

conda list -n snowflakes

Search for a package:

conda search beautiful-soup

Install a package:

conda install --name bunnies beautiful-soup

NOTE: If you do not specify the name of the environment where you want it installed (–name bunnies) it will install in the current environment. Activate the bunnies environment, and do a conda list to see the new program installed: Linux, OS X: source activate bunnies

For packages that are not available using conda install, we can look in the repository Anaconda.org. Anaconda.org.Find the package you want and click to go to the detail page. There you will see the name of the channel – in this case it is the “pandas” channel.

conda install -c pandas bottleneck

Package update:

conda update biopython
conda update conda
conda update python

Package remove:

conda remove --name bunnies iopro

conda manage environments

Create an environment:

conda create --name snowflakes biopython

This will create a new environment named /envs/snowflakes that contains the program Biopython. This environment will use the same version of Python that you are currently using, because you did not specify a version.

Change environments (activate/deactivate) Linux, OS X: source activate snowflakes Linux, OS X: source deactivate

Create a separate environment:

conda create --name bunnies python=3 astroid babel

List all environments:

conda info --envs
conda env list

Clone an environment:

conda create --name flowers --clone snowflakes

Remove an environment

conda remove --name flowers --all

Create environment file by hand:

 conda env create -f environment.yml

Here is an example of a simple environment file:

name: stats
dependencies:
  - numpy
  - pandas

And here is an example of a somewhat more complex environment file:

name: stats2
channels:
  - javascript
dependencies:
  - python=3.4   # or 2.7
  - bokeh=0.9.2
  - numpy=1.9.*
  - nodejs=0.10.*
  - flask
  - pip:
    - Flask-Testing

results matching ""

    No results matching ""