Python-package installing with pip (on a mac)

Posted by

Tempted in by the iPad, i’ve just now moved the home system across to a mini-Mac (server). This morning i was moving the snake-charming across, and was surprised at how easy it was.

First up, you have python on your mac. To check the packaged version, type python into the terminal and hit enter (apple-space opens the search bar, type in terminal and hit enter and the terminal opens).

Happy with the version?

Either way, control-D to close, and exit back into the shell. I was happy, so i’ll assume you were also.

The mac comes with easy install, but i prefer pip, as it looks after dependencies also – it’s like the wonderful install.packages(‘__’) command in R.

So …

sudo easy_install pip

enter your password, and wait …

once that’s done, let’s use pip to install a few packages

pip install beautifulsoup4

pip install mechanize

easy!

2 comments

Comments are closed.