1

Being fairly new to programming, I am having trouble understanding exactly what Homebrew does... or rather - why it is needed. I know it contains pip for package management, but so does Virtualenv and I'm planning on installing this in due course.

Does Homebrew install another version of python that is not the system version, upon which you would install Virtualenv and manage the different development environments from there?

I have a clean install of OSX Lion and I want to keep my projects separated, but am unsure why I need Homebrew.

I realise this is basic stuff, but if someone could explain it, I would be grateful.

0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
puffin
  • 1,331
  • 4
  • 15
  • 18

2 Answers2

2

Homebrew is just a package manager for Mac, like pip for Python. Of course you never need a package manager, you can just get all the programs, or libraries in case of pip and Pypi yourself. The point of package managers however is to ease this process and give you a simple interface to install the software, and also to remove it as that is usually not so simply when compiling things yourself etc.

That being said, Homebrew will only install things you tell it to install, so by just having Homebrew you don’t randomly get new versions of something. Homebrew is just a nice way to install general OSX stuff you need/want in general.

poke
  • 369,085
  • 72
  • 557
  • 602
  • 1
    So Homebrew isn't used to install python libraries? It doesn't sound like I need it at the moment. I don't need to install things like w-get or unix tools. I might try it in case I require it later. Thanks for your answer. – puffin Jun 26 '12 at 20:12
  • 2
    No, Homebrew is meant solely for installing things for OSX (like apt for Debian-based Linux systems). You can see a complete list of available packages (or “Formulas” as they call them) [here](https://github.com/mxcl/homebrew/tree/master/Library/Formula). If you want to install Python libraries you have to use *pip* (or even *easy_install*) to access the the Python Package Index (PyPI). – poke Jun 26 '12 at 20:17
0

pip and virtualenv are python libraries and can be installed in any working python install including the one supplied by Apple as part of OSX and the python.org version.

Then it depends on what you need from python - if you just have to install python libraries or simple C linraries then you can just use easy_install and then pip, vittualenv other python tools.

If you are using more complex C libraries e.g. python interface for mysql then it helps to use a package manager like macports, homebrew or fink as the port writers will have sorted out the tricky dependencies. There are also other python installs from Enthought and Activestate that deal with some of the non simple cases e.g. scipy but are not general purpose package managers.

Macports and fink will install a separate version of python in /opt/local/bin or /sw/bin whilst I think homebrew will use Apple's python. *The difference is due to a difference of view of the package mangers design. Macports and fink were developed by people who experienced a lot of issues with different versions of software and so said that all our installs will be in a place only the package manager uses whilst Homebrew trys to use as much of the Apple supplied tools as possible so to add as little as needed.

Community
  • 1
  • 1
mmmmmm
  • 32,227
  • 27
  • 88
  • 117
  • So should I be installing a python version with homebrew, then changing my .bash_profile to look to the homebrew version rather than the system python and moving forward from there? As I understand it, I can install a new 'flavour' of python using homebrew and point my .bash_profile to it. What I need from python is access to a versions of 2.7 and 3.2. I'd prefer to not touch the apple installed python, just to keep everything as organised as possible. – puffin Jun 26 '12 at 23:10