Conda 简单使用



conda create -n python2 python=2.7




直接用 conda install 并用 -n 指明安装到的环境,这里自然就是 python2 。
像 virtualenv 那样,先activate,然后在虚拟环境中安装。


$ conda create -n py33test anaconda=1.9 python=3.3 numpy=1.8

$ source activate py33test

Single libraries and packages can be installed using the  conda install command, either
in the general  Anaconda installation:
$ conda install scipy
or for a specific environment, as in:
$ conda install -n py33test scipy
Here,  py33test is the environment we created before. Similarly, you can update single
packages easily:
$ conda update pandas
The packages to download and link depend on the respective version of the package that is
installed. These can be very few to numerous, e.g., when a package has a number of
dependencies for which no current version is installed. For our newly created
environment, the updating would take the form:
$ conda update -n py33test pandas
Finally,  conda makes it easy to remove packages with the  remove command from the main
installation or a specific environment. The basic usage is:
$ conda remove scipy
For an environment it is:
$ conda remove -n py33test scipy
Since the removal is a somewhat “final” operation, you might want to dry run the
$ conda remove —dry-run -n py33test scipy
If you are sure, you can go ahead with the actual removal. To get back to the original
Python and  Anaconda version, deactivate the environment:
$ source deactivate
Finally, we can clean up the whole environment by use of  remove with the option  —all :
$ conda remove —all -n py33test
The package manager  conda makes  Python deployment quite convenient. Apart from the
basic functionalities illustrated in this section, there are also a number of more advanced
features available. Detailed documentation is found at

posted on 2017-03-21 16:40  cndavy  阅读(611)  评论(0编辑  收藏