安装目录
1. python
2. Ipython
3. qtconsole
4. Numpy
5. Scipy
6. matplotlib
7. scikit-learn
1. 安装 python2.7 (or python3.4)
Windows用户
下载,安装
正确设置PATH变量:进入 computer > Control Panel > All Control Panel Items > System > Advanced system setting > environment variables,然后点击 "Path" 然后添加 ";\C:\Python27"(或者Python33)
这样就可以在命令行界面(CLI)打开Python
Mac用户
Mac自带Python2.7
可以先安装Homebrew,命令$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)",然后再安装Python3.4,命令$ brew install python3
2. 安装 Ipython
Ipython
2.1 整体安装
Windows用户
$ python -m pip install ipython[all]
Mac用户
$ pip install ipython[all]
[all] 意味着会下载并安装Ipython以及相关需要的其他包:
jinja2needed for the notebook
sphinxneeded for nbconvert
pyzmqneeded for IPython’s parallel computing features, qt console and notebook
pygmentsused by nbconvert and the Qt console for syntax highlighting
tornadoneeded by the web-based notebook
noseused by the test suite
readline (on OS X) or pyreadline (on Windows)needed for the terminal
还有一些不能通过pip安装,需要单独安装比如:Qt, PyQt 和 pandoc
2.2 独立安装
2.2.1 安装Ipython本身
Windows用户
install setuptools
$ python -m pip install pyreadline
$ python -m pip install ipython
Mac用户
pip install ipython
2.2.2 安装基础相关包(Basic optional dependencies )
readline(for command line editing, tab completion, etc.)
python -m pip install "ipython[terminal]"
nose(to run the IPython test suite)
python -m pip install "ipython[test]"
pyzmq(for IPython.parallel (parallel computing))
python -m pip install "ipython[parallel]"
notebook(Dependencies for the IPython HTML notebook)
python -m pip install "ipython[notebook]"
IPython notebook使用web的形式,使用时输入ipython notebook
支持IPython notebook的浏览器有:
Chrome ≥ 13
Safari ≥ 5
Firefox ≥ 6
Ipython notebook貌似还挺强大的,这里来不及深入,以后有时间会好好研究一下
更多信息,参考Ipython官网
3. 安装 qtconsole
包含:pyzmq、pygments 和 PyQt(or PySide)
$ pip install pyzmq pygments
Shortcut:
$ pip install "ipython[qtconsole]"
PyQt/PySide不能通过pip安装
Windows用户
下载PyQt4 for python2.7 windows 32bit
Mac用户
下载SIP包
下载Qt包
下载PyQt4包
安装 Qt
安装 SIP
安装 PyQt
4. 安装 Numpy
Windows用户
下载地址
Mac用户
$ pip install numpy
5. 安装 Scipy
Windows用户
下载地址
Mac用户
$ pip install scipy
或者下载地址
6. 安装 matplotlib
matplotlib
matplotlib是基于numpy的一套Python工具包,提供了丰富的数据绘图工具。
Windows用户
下载地址
Mac用户
下载地址
注: 使用命令pip list查看除了matplotlib你是否还安装了:
setuptools
numpy
Python-dateutil
pytz
pyparsing
7. 安装 scikit-learn
scikit-learn
scikit-learn是用于机器学习的Python工具包
为数据挖掘和数据分析提供简单高效的工具
基于NumPy, SciPy, 和 matplotlib
开源,BSD license
Scikit-learn需要环境:
Python (>= 2.6 or >= 3.3)
Numpy (>= 1.6.1)
Scipy (>= 0.9)
Windows用户
python -m pip install -U scikit-learn
Mac用户
pip install -U scikit-learn
大功告成,play with data and have fun!