Anaconda把常用的包都集成在了一起,因此我们实际上从头到尾只需要安装Anaconda软件就行了,其它什么都不用装。
1.下载并安装 anaconda
先到https://www.continuum.io/downloads 下载anaconda, 现在的版本有python2.7版本和python3.5版本,下载好对应版本、对应系统的anaconda。
以windows7+python3.5为例
2.名称为: Anaconda3-2.4.1-Windows-x86_64.exe
是一个可执行的exe文件,下载完成好,直接双击就可以安装了。
安装过程中将安装路径写入环境变量。然后等待安装完成就可以了。
3.安装完成后,打开windows的命令提示符:
输入conda list 就可以查询现在安装了哪些库,常用的numpy, scipy名列其中。如果你还有什么包没有安装上,可以运行
conda install *** 来进行安装。(***为需要的包的名称)
如果某个包版本不是最新的,运行 conda update *** 就可以更新了。
4.anaconda自带了一款编辑器spyder,我们以后就可以用这款编辑器来编写代码。
spyder.exe放在安装目录下的Scripts里面,如我的是 D:/Anaconda3/Scripts/spyder.exe, 直接双击就能运行。我们可以右键发送到桌面快捷方式,以后运行就比较方便了。
5.conda 命令
• conda help: Displays the list of conda commands.
• conda list: Lists all packages installed in the current environment.
• conda info: Displays system information.
• conda env list: Displays the list of environments installed. The currently active one is marked by a star *.
• conda install somepackage: Installs a Python package (replacesome package by the name of the package you want to install).
• conda install somepackage=0.7: Installs a specific version of a package.
• conda update somepackage: Updates a Python package to the latest available version.
• conda update anaconda: Updates all packages.
• conda update conda: Updates conda itself.
• conda update --all: Updates all packages.
• conda remove somepackage: Uninstalls a Python package.
• conda remove -n myenv --all: Removes the environment named myenv
(replace this by the name of the environment you want to uninstall).
• conda clean -t: Removes the old tarballs that are left over after installation and updates.