1. conda info
provides information about Anaconda environments.
2. conda info --envs [conda info -e]
displays the ROOT_DIR Anaconda directory, and test environments within it.
3. conda info --license
displays information about local licenses, including what they are and where they are located.
4. conda info --systemTo display all relevant information at once, use the conda info --all option.
List
1. conda list -p [$ conda list -p ~/envs/test2]
shows the linked packages and their versions in a specificenvironment directory. --prefix also works. If no prefix is provided,conda will look in the default environment.
2. $ conda list ^py
In this next example, we leave off the prefix and search for packages starting with py in the default directory.
conda search is a versatile option that can be used to explore packages available from known repositories or installed locally.
1. $ conda search scipy
In the first example, we want to simply search for SciPy and see if it is inconda’s list of packages.
2.$ conda search -p ~/anaconda/envs/onlyScipy/
Using the prefix option (-p), we can select an environment, and search for all packages that are compatible with it.
It is also possible to get the same output as the above example by using the name option (-n) with the name of an Anaconda environment.
In this example, we use conda create to make an environment ina directory (specified with -p/--prefix), for one or more packages. We have also chosen to displaya progress bar, displayed as it creates the environment.
1. $ conda create -p ~/anaconda/envs/test2 anaconda=1.4.0 python=2.7 numpy=1.6
创建环境并安装 anaconda
We’ll start with an environment created in a specific path (~/anaconda/envs/test2) using the –prefix option (-p).
2. $ conda create --quiet --yes -n foo python
In this next example, rather than selecting an environment directory with a prefix, we will use the name option (-n/--name).This will create an environment in the default Anaconda/envs ROOT_DIR(which can be displayed by using conda info),where it will be discoverable by using conda’sinfo –envs option.
It is possible to disable a progress bar (--quiet) if you don’t wish to show the status of anypackages conda has to download. You can also skip the Proceed(y/n)? check with --yes
conda update replaces old packages in a given environment with the latestversions. Note that Python will not update past the major version that isinstalled (so for example, if Python 2.7.4 is installed, conda update python willinstall Python 2.7.7, not 3.4.1).
1. conda update -p /tmp/matplotlib matplotlib
For this first example, we will use an environment /tmp/matplotlib, which we can select using the prefix (-p) option.
2. $ conda update -n matplot matplotlib
For this next example, we will do almost the same thing, but instead of using the prefix option, we will use name (-n)on an environment /home/test/anaconda/envs/matplotlib.
conda install places a package in an environment that may already exist,in this case /envs/myenv.
As before, conda will link all necessary dependencies.
1. $ conda install -p ~/anaconda/envs/myenv scipy
In this next example, using the name (-n) option will install a package or packages in an existing environment located in~/anaconda/envs.
As with conda create, we can use the --yes and --quiet options to automatically answer yes to the confirmation question andhide the progress bar, respectively.
联系客服