advice about python

Discussion in 'Mac Programming' started by ruqui, Jul 2, 2014.

  1. ruqui macrumors newbie

    ruqui

    Joined:
    Jan 22, 2013
    #1
    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?
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    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.
     
  3. hiddenmarkov macrumors 6502a

    Joined:
    Mar 12, 2014
    Location:
    Japan
    #3
    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.
     
  4. ArtOfWarfare macrumors G3

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #4
    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.
     

Share This Page