python科学计算发⾏版Anaconda安装使⽤教程
版权声明:本⽂为博主原创⽂章,未经博主允许不得转载。 blog.csdn/bitcarmanlee/article/details/51917642
1.原⽣python的不⽅便
作为⼀个数据与算法⼯作者,python的使⽤频率很⾼。现阶段python做科学计算的标配是
numpy+scipy+matplotlib+sklearn+pandas。可惜的是,原⽣的python是不带这些包的。于是,每次遇到⼀个新机器,需要安装这些包。更可⽓的是,昨晚本博主为了在新机器上安装sklearn,⾜⾜花了两⼩时,中间踩了⽆数之前没遇到过的天坑加上天朝坑爹的⽹络。。。作为⼀个搭建了⽆数次科学计算环境的⽼司机还遇到这种情况,估计新⼿们就更⽆⽐郁闷了。于是⽼司机就想,有没有⼀个东西把所有常⽤的科学计算⼯具都集成好,这样就省了每次搭环境的天坑。。。google⼀把,发现了今天⽂章的主⾓:Anaconda。
2.先看看Anaconda是个什么⿁
通过上⾯这段⽜逼闪闪的介绍,我们知道Anaconda是⼀个基于python的科学计算平台,这个平台⾥包含有python,r,scala等绝⼤部分主流的⽤于科学计算的包。
接下来⾃然就是开始下载了。因为集成有很多⽜逼科学计算包的缘故,所以安装包⾃然也⼩不了,⽐如我下载的mac版就有360M。那就慢慢下着吧。还好⽹络虽然不是很快,好⽍还是稳定的,能到⼀两百k,⼀个⼩时左右能下完。这段时间就先⼲点别的吧。
3.安装配置
下载完成以后,跟mac⾥安装普通软件⼀样,双击安装即可。
安装完以后,开始进⾏相应的配置。因为我平时使⽤eclipse开发,正好官⽹都贴⼼地给出了在IDE⾥怎么配置使⽤,⾥⾯就有eclipse,前提是eclipse已经安装了pydev插件。
以下eclipse配置⽅法来⾃官⽹:
After you 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 “Interpreter Name” box, type “Anaconda Python”.
Browse 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 display Anaconda Python. Click OK.
电脑python安装教程You are now ready to use Anaconda Python with your Eclipse and PyDev installation.
4.查看Anaconda的基本⽤法
配置完成以后,查看⼀下此时系统的python:
lei.wang ~ $ which python
/Users/lei.wang/anaconda/bin/python
lei.wang ~ $ python --version
Python 2.7.12 :: Anaconda 4.1.1 (x86_64)
此时,系统默认的python已经变成了Anaconda的版本!
为什么会这样呢?原来是安装过程中,偷偷给我们在home⽬录下⽣成了⼀个.bashrc_profile⽂件,并在⾥⾯加⼊了PATH:
# added by Anaconda2 4.1.1 installer
export PATH="/Users/wanglei/anaconda/bin:$PATH"
所以这个时候我们的bash⾥使⽤python的话,已经指向了anaconda⾥的python解释器。
如果使⽤的不是mac的标准bash,⽽是zsh,不⽤着急,将上⾯⼀⾏配置复制粘贴到.zshrc⽂件中,然后source⼀下.zshrc⽂件即可!执⾏⼀下conda命令:
lei.wang ~ $ conda
usage: conda [-h] [-V] [--debug] command ...
conda is a tool for managing and deploying applications, environments and packages.
Options:
positional arguments:
command
info Display information about current conda install.
help Displays a list of available conda commands and their help
strings.
monday发音音标list List linked packages in a conda environment.
search Search for packages and display their information. The input
is a Python regular expression. To perform a search with a
search string that starts with a -, separate the search from
the options with --, like 'conda search -- -h'. A * in the
results means that package is installed in the current
environment. A . means that package is not installed but is
cached in the pkgs directory.
create Create a new conda environment from a list of specified
packages.
install Installs a list of packages into a specified conda
environment.
update Updates conda packages to the latest compatible version. This
command accepts a list of package names and updates them to
the latest versions that are compatible with all other
packages in the environment. Conda attempts to install the
newest versions of the requested packages. To accomplish
this, it may update some packages that are already installed,
or install additional packages. To prevent existing packages
from updating, use the --no-update-deps option. This mayreaction反应视频
force conda to install older versions of the requested
packages, and it does not prevent additional dependency
drawline是什么意思
packages from being installed. If you wish to skip dependency
checking altogether, use the '--force' option. This may
result in an environment with incompatible packages, so this
option must be used with great caution.
upgrade Alias for conda update. See conda update --help.
remove Remove a list of packages from a specified conda environment.
uninstall Alias for conda remove. See conda remove --help.
config Modify configuration values in .condarc. This is modeled
after the git config command. Writes to the user .condarc
file (/Users/lei.wang/.condarc) by default.
init Initialize conda into a regular environment (when conda was
installed as a Python package, e.g. using pip). (DEPRECATED)
clean Remove unused packages and caches.
package Low-level conda package utility. (EXPERIMENTAL)
bundle Create or extract a "bundle package" (EXPERIMENTAL)
...
信息太长了,后⾯的部分就不列举了。不过看到前⾯这部分选项,就已经⾜够让我们兴奋了:基本的
list,search,install,upgrade,uninstall等功能都包含,说明我们可以向apt-get⼀样⽅便管理python的各种依赖了。。。先list⼀下,查看⾥⾯都带了哪些⽜逼闪闪的科学计算包:
ei.wang ~ $ conda list
rpcbind服务默认端口# packages in environment at /Users/lei.wang/anaconda:
#
_nb_ext_conf 0.2.0 py27_0
alabaster 0.7.8 py27_0
anaconda 4.1.1 np111py27_0
anaconda-client 1.4.0 py27_0
anaconda-navigator 1.2.1 py27_0
appnope 0.1.0 py27_0
appscript 1.0.1 py27_0
argcomplete 1.0.0 py27_1
astropy 1.2.1 np111py27_0
babel 2.3.3 py27_0
backports 1.0 py27_0
backports_abc 0.4 py27_0
beautifulsoup4 4.4.1 py27_0
bitarray 0.8.1 py27_0
blaze 0.10.1 py27_0
bokeh 0.12.0 py27_0
boto 2.40.0 py27_0
bottleneck 1.1.0 np111py27_0
cdecimal 2.3 py27_2
cffi 1.6.0 py27_0
chest 0.2.3 py27_0
click 6.6 py27_0
cloudpickle 0.2.1 py27_0
clyent 1.2.2 py27_0
colorama 0.3.7 py27_0
conda 4.1.6 py27_0
conda-build 1.21.3 py27_0
conda-env 2.5.1 py27_0
configobj 5.0.6 py27_0
configparser 3.5.0b2 py27_1
contextlib2 0.5.3 py27_0
cryptography 1.4 py27_0
curl 7.49.0 0
cycler 0.10.0 py27_0
cython 0.24 py27_0
cytoolz 0.8.0 py27_0
dask 0.10.0 py27_0
torrent文件如何查看datashape 0.5.2 py27_0
decorator 4.0.10 py27_0
dill 0.2.5 py27_0
docutils 0.12 py27_2
dynd-python 0.7.2 py27_0
entrypoints 0.2.2 py27_0
enum34 1.1.6 py27_0
et_xmlfile 1.0.1 py27_0
fastcache 1.0.2 py27_1
flask 0.11.1 py27_0
flask-cors 2.1.2 py27_0
freetype 2.5.5 1
funcsigs 1.0.2 py27_0
functools32 3.2.3.2 py27_0
futures 3.0.5 py27_0
get_terminal_size 1.0.0 py27_0
gevent 1.1.1 py27_0
greenlet 0.4.10 py27_0
grin 1.2.1 py27_3
h5py 2.6.0 np111py27_1
hdf5 1.8.16 0
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论