python科学计算发行版Anaconda安装使用教程

上传人:枫** 文档编号:488009848 上传时间:2022-12-21 格式:DOC 页数:41 大小:100.50KB
返回 下载 相关 举报
python科学计算发行版Anaconda安装使用教程_第1页
第1页 / 共41页
python科学计算发行版Anaconda安装使用教程_第2页
第2页 / 共41页
python科学计算发行版Anaconda安装使用教程_第3页
第3页 / 共41页
python科学计算发行版Anaconda安装使用教程_第4页
第4页 / 共41页
python科学计算发行版Anaconda安装使用教程_第5页
第5页 / 共41页
点击查看更多>>
资源描述

《python科学计算发行版Anaconda安装使用教程》由会员分享,可在线阅读,更多相关《python科学计算发行版Anaconda安装使用教程(41页珍藏版)》请在金锄头文库上搜索。

1、python 科学计算 发行版 Anaconda 安装使用教程1. 原生 python 的不方便 作为一个数据与算法工作者, Python 的使用频率很高。 现阶 段 python 做科学计算的标配是 numpy+scipy+matplotlib+sklearn+pandas 。可惜的是, 原生 的 python 是不带这些包的。于是,每次遇到一个新机器, 需要安装这些包。更可气的是,昨晚本博主为了在新机器上 安装 sklearn ,足足花了两小时,中间踩了无数之前没遇到 过的天坑加上天朝坑爹的网络。 。作为一个搭建了无数次科 学计算环境的老司机还遇到这种情况,估计新手们就更无比 郁闷了。于是

2、老司机就想,有没有一个东西把所有常用的科 学计算工具都集成好,这样就省了每次搭环境的天坑。 。 google 一把,发现了今天文章的主角: Anaconda 。2. 先看看 Anaconda 是个什么鬼 Anaconda :蟒蛇,估计来源就是 python logo 里那条可爱的 小蟒蛇吧。mac 版下载地址: https:/www.continuum.io/downloads#_macosx看看官网首页是怎么介绍的:Anaconda is the leading open data science platform powered by Python. The open source ver

3、sion of Anaconda is a high performance distribution of Python and R and includes over 100 of the most popular Python, R and Scala packages for data science. Additionally, you ll have accessto over 720 packages that can easily be installed with conda, our renowned package, dependency and environment

4、manager, that is included in Anaconda.Anaconda is BSD licensed which gives you permission to use Anaconda commercially and for redistribution. See the packages included with Anaconda and the Anaconda changelog.通过上面这段牛逼闪闪的介绍,我们知道 Anaconda 是一个 基于 python 的科学计算平台,这个平台里包含有 python,r,scala 等绝大部分主流的用于科学计算的包

5、。 接下来自然就是开始下载了。因为集成有很多牛逼科学计算 包的缘故,所以安装包自然也小不了,比如我下载的 mac 版就有 360M 。那就慢慢下着吧。还好网络虽然不是很快, 好歹还是稳定的,能到一两百 k ,一个小时左右能下完。这 段时间就先干点别的吧。3. 安装配置下载完成以后, 跟 mac 里安装普通软件一样, 双击安装即可 安装完以后, 开始进行相应的配置。 因为我平时使用 eclipse 开发,正好官网都贴心地给出了在 IDE 里怎么配置使用,里 面就有 eclipse ,前提是 eclipse 已经安装了 pydev 插件。 以下 eclipse 配置方法来自官网:After you

6、 have Eclipse, PyDev, and Anaconda installed, follow these steps to set Anaconda Python as your default by adding it as a new interpreter, and then selecting that new interpreter:Open the Eclipse Preferences window:Go to PyDev - Interpreters - Python Interpreter.Click the New button:In the “ Interpr

7、eter Name” box, typeAnaconda PythonBrowse to /anaconda/bin/python or wherever your Anaconda Python is installed.Click the OK button.In the next window, select all the folders and click the OK button again to select the folders to add to the SYSTEM python path.The Python Interpreters window will now

8、display Anaconda Python. Click OK.You are now ready to use Anaconda Python with your Eclipse and PyDev installation.如果是其他 IDE ,可以上官网查看其他配置方法。 具体地址: https:/docs.continuum.io/anaconda/ide_integration#id84. 查看 Anaconda 的基本用法 配置完成以后,查看一下此时系统的 python : lei.wang $ which python /Users/lei.wang/anaconda/bin

9、/python lei.wang $ python -versionPython 2.7.12 : Anaconda 4.1.1 (x86_64)12341234 此时,系统默认的 python 已经变成了 Anaconda 的版本!为什么会这样呢?原来是安装过程中,偷偷给我们在 home 目录下生成了一个 .bashrc_profile 文件,并在里面加入了 PATH :# added by Anaconda2 4.1.1 installerexport PATH=/Users/wanglei/anaconda/bin:$PATH1212 所以这个时候我们的 bash 里使用 python

10、的话, 已经指向了 anaconda 里的 python 解释器。如果使用的不是 mac 的标准 bash ,而是 zsh ,不用着急, 将上面一行配置复制粘贴到 .zshrc 文件中,然后 source 一 下 .zshrc 文件即可! 执行一下 conda 命令:lei.wang $ condausage: conda -h -V -debug command .conda is a tool for managing and deploying applications, environments and packages.Options:positional arguments:com

11、mandinfoDisplay information about current condainstall.helpDisplays a list of available condacommands and their helpstrings.list List linked packages in a conda environment.searchSearch for packages and display theirinformation. The inputis a Python regular expression. To perform a search with asear

12、ch string that starts with a -,separate the search fromthe options with -, like conda search -h. A * in theresults means that package is installed in the currentenvironment. A . means that package is not installed but iscached in the pkgs directory.createCreate a new conda environment from alist of

13、specifiedpackages.installInstalls a list of packages into a specifiedcondaenvironment.updateUpdates conda packages to the latestcompatible version. Thiscommand accepts a list of package names and updates them tothe latest versions that are compatible with all otherpackages in the environment. Conda

14、attempts to install thenewest versions of the requested packages. To accomplishthis, it may update some packages that are already installed,or install additional packages. To prevent existing packagesfrom updating, use the-no-update-deps option. This mayforce conda to install older versions of the r

15、equestedpackages, and it does not prevent additional dependencypackages from being installed. If you wish to skip dependencychecking altogether, use the -force option. This mayresult in an environment with incompatible packages, so thisoption must be used with great caution. upgradeAlias for conda update. See condaremoveupdate -help.Remove a list of packages from aspecified conda environment.uninstallAlias for conda remove. See condaremove -help.configModify configuration values in .condarc.This is modeledafter the git config command. Writes tothe user .condarcfile (/Users/lei.wa

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号