Install NumPy, SciPy, scikit-learn on Mac OS X

Add on and summarized from blog
http://penandpants.com/2012/02/24/install-python/


Outline

1. install Xcode –> 2. install pip –> 3. install brew –> 4. install NumPy –> 5. install gfortran (important!) –> 6. install SciPy –> 7. install matplotlib (useful) –> 8. install scikit-learn –> 9. test

Preamble:

Python 2.5 ~ above is preinstalled in the current Mac OS lion. To make sure, in terminal (search in spotlight), type python after $, you should be able to see the python version installed and prompted to the python interpretation environment. Else type “sudo easy_install python” to intall python2.

  1. Download Xcode from app store and install it. After that, open installed Xcode, go to Preferences –> Download–> Command Line Tools, click ‘install’ to install the commands which are not installed in the shell.

  2. The following steps will all be done in terminal. For this step, sudo easy_install pip.

  3. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  4. sudo pip install numpy

  5. brew install gfortran –> this is a critical step before installing scipy, as many dependencies of the latter is contained in this package

  6. sudo pip install scipy

  7. sudo pip install matplotlib

  8. sudo pip install scikit-learn

  9. launch python and test the installed packages.

(after $) python –>

(after >>>)

import numpy

import scipy

import matplotlib

import sklearn

Successfully installed all the packages if no error found after the import!

In addition, pandas can also be a handy library for data analysis, to install:

sudo pip install pandas

END

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值