Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ruqui

macrumors newbie
Original poster
Jan 22, 2013
29
0
I need to start working with Python on my Macbook and I must install several third party modules.

I'm wondering what is the best option to do that, should I install them on the default Python installation that comes with Mavericks or is it better to install a separate Python version (using brew or similar) and do all the module installation/modifications there?
 
I need to start working with Python on my Macbook and I must install several third party modules.

I'm wondering what is the best option to do that, should I install them on the default Python installation that comes with Mavericks or is it better to install a separate Python version (using brew or similar) and do all the module installation/modifications there?

Install virtualenv and then install the packages in a new virtual environment for each project of yours and then just use the version of Python that comes with your version of Mac OS X.

Using virtualenv is considered a best practice in the Python community. If you want to use Python 3.4.x then you'll need to install it from Homebrew. Note that Python 3.4.x comes with its own version of virtualenv called venv which works in much the same way and should be used in the same way as well.
 
you could also look at pyenv. Its in homebrew as well.

https://github.com/yyuu/pyenv#homebrew-on-mac-os-x


Generally with unix/Linux/bsd its best to leave stock python in place and unmodded and run these projects instead.

Vendors of the flavor update scripts if python based will look for stock. You'd also want stock perl in place as well. There are similar projects in place for perl as well if you ever go do down that route as well.
 
I download and install the latest 2.7 or 3.x, then I use pip to manage download and installation of Python packages. As of 3.3 pip now comes with the standard install of Python, but older versions (including the latest 2.7.x) don't include it... And I think the roadmap for 2.7 is considered final now... I believe they'll be releasing 2.7.9 in about a year with minor bug fixes, then will only be doing security fixes on that line if issues arise after that... So Pip will probably never become an official part of Python 2.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.