2
$\begingroup$

I just got a new Macbook and decided to install everything from scratch instead of migrating. Previously I've always installed SciPy etc. through MacPorts, but lately MacPorts as a whole seems not to be as cleanly maintained as it once was, and I spend a lot of time tracking down problems with it. I also generally used MacPorts (rather than pip or easy_install) to install Python libraries.

So I was wondering if there is a better way to install SciPy and friends these days. I know that there are a number of all-in-one packages such as Anaconda, but I don't know if that's better or worse than using MacPorts to install the lot. I also know that Homebrew exists as a more recent alternative to MacPorts, but in searching for comparisons between the two I haven't gleaned much useful information.

So my question is whether it is generally recommended to install Anaconda or another similar package, or to use MacPorts or Homebrew, or some other solution. I realise this question could be a little opinion-based, so I'd appreciate it if answers would stick to relevant facts about the various options, as they relate to maintaining a scientific Python distribution.

Also, if I do use MacPorts or Homebrew, should I generally reach for the package manager when I want to install a new library, or is it better to just install the basic packages that way and use pip for everything else?

$\endgroup$
2
  • 1
    $\begingroup$ I use homebrew for the same reasons you mention, and haven't had any real trouble (excepting a premature switch to El Capitan). In particular, you can control via options whether you want to build from a stable release or the current developer repository, and, specifically for NumPy/SciPy, to build and link against OpenBLAS. Upgrading is also easy. As a rule of thumb, everything that can be installed via homebrew, I do so -- particularly packages that need to build and link against external libraries -- and resort to pip only for pure Python packages not distributed via homebrew (e.g., Sympy). $\endgroup$ Mar 9, 2016 at 10:32
  • 1
    $\begingroup$ I don't think this is the place for this question. You should have asked it on SO, Unix SE or Super User. $\endgroup$
    – Eliad
    Mar 12, 2016 at 21:08

3 Answers 3

1
$\begingroup$

The only missing part I see to the previous answer is the Anaconda package that you mentioned. I just wanted to add that it seems appropriate for a 'lazy' installation via graphical installer.

The downside is that it installs a lot of packages, and some of them may be uninteresting for your use.

$\endgroup$
1
  • 1
    $\begingroup$ Anaconda by Continuum Analytics is by far the easiest way to install Python on Mac, Windows, and Linux. If you don't want every scientific package, you can install miniconda then use conda to install only the packages that you need. More info at conda.pydata.org/miniconda.html $\endgroup$
    – wigging
    Jun 9, 2016 at 18:28
0
$\begingroup$

I rather suspect that the answers to this will be almost entirely opinion based, with the right answer depending on what you already have (or need) on your system but in terms of mostly verifiable facts I claim:

  • Writing your own Homebrew recipes involves using Ruby, which looks better on a cv and is slightly more useful these days than tcl as used by Macports. This only matters when the available packages don't support what you want to do, but for heavy scientific computation this is depressingly common.

  • Macports is still a good deal stricter about building its entire tool chain rather than using mac supplied tools. This is most likely to matter to you if you're compiling against python, when getting the flags right for the build process gets a bit more insane, but the final result can be made more gcc friendly.

  • Macports had significantly more packages the last time I checked, although the implementation of the variants system can mean that packages from different maintainers don't play nicely together, particularly when openmpi and compiler choices are important.

  • pip plus virtualenv makes for nice sandbox environments when packages don't play nicely together (I'm thinking in particular of various tools under the aegis of the FEniCS project). I've been told that pip uninstall doesn't always do what you expect, but I haven't ever run into that myself.

Disclosure: I mostly use macports and haven't dared to upgrade to El Capitan yet.

$\endgroup$
0
$\begingroup$

I use pip as a package manager and PyCharm as my environment. I had Anaconda installed for awhile, but found it difficult to integrate libraries that weren't part of the Anaconda distribution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.