Python Installation and Ecosystem Tutorial

by Guest on April 11, 2012

This is a guest post from Tom Aldcroft. Tom is an astrophysicist working at the Harvard-Smithsonian Center for Astrophysics in Cambridge MA. In addition to science research he has responsibilities supporting mission operations for the Chandra X-ray Observatory. In both areas he uses Python on a daily basis and will gladly tell you about his fun projects, even if it embarrassingly winds up on YouTube. He is a leader in the astronomy Python community and works with colleagues at CfA on and the Practical Python for Astronomers workshop series.

Practical Python for Astronomers, which was described by Tom R. last May, is a series of hands-on workshops to explore the Python language and the powerful analysis tools it provides.  The emphasis is on using Python to solve real-world problems that astronomers are likely to encounter in research.

We have recently updated and expanded the workshop on Python Installation and Understanding Packages.  In these pages you will find detailed instructions for how to install several flavors of Python on Mac, Linux, and even Windows. We present a table that shows the most common installation options (e.g. EPD or MacPorts) and highlights the relative merits and weaknesses of each.  From there the workshop describes managing your Python environment, including the process for installing new packages to your Python, understanding where all the files live, and how to deal with multiple Python installations like MacPorts, CIAO, and stsci_python on your system.  If you are new to Python or just confused by all the choices then you should have a look.

I hope someday there will be one clearly superior solution for installation, but we’re not there yet. In the meantime, please share in the comments any feedback you might have on this newly updated python installation guide.

{ 3 comments… read them below or add one }

1 John April 11, 2012 at 10:06 am

This is a nice summary!

Note that the MacPorts project is now increasingly providing pre-compiled binary packages so the drawback of being “slow to install” is becoming less of a problem. Yay!

…on the other hand, the recent XCode changes put a question mark over it being “generally stable after Mac OS system or security updates”…


2 Elisabeth Newton April 12, 2012 at 2:59 pm

This is great! I just used MacPorts to get python on my laptop. It took about an hour for everything to install (plus the time it took me to realize that the reason the port command wasn’t working was that I need to source my .cshrc file).


3 Jane Rigby April 12, 2012 at 4:53 pm

Tom, this is a bit off-topic, but have you considered doing a webinar version of your Practical Python for Astronomers class? Obviously anyone can take your class at their own pace on their own, but often people are more motivated when they’re part of a group, even a geographically dispersed group, all learning something at once.


Leave a Comment

Previous post:

Next post: