July 03, 2013

Back in the (scientific) python business!


The above five lines of python represent the accomplishment of a (small) summer goal of mine: to have one cohesive python install with all of my favorite python packages for writing code for physics classes and research.

I don't know what happened earlier this year, but I had b0rked up my python install on my school laptop. I have a Macbook Pro, and was running into all sorts of problems: 32 bit vs. 64 bit, which install of python to use and whether or not I could use matplotlib and vpython at the same time.

What I ended up with was two installs of python: one that could use vpython and one that could use matplotlib, but never the two at the same time.

As you can see in the screenshot, I have everything working now with the excellent enthought distribution of python. What I learned today was that ALL  the packages in the vpython dmg file are required to run vpython. I don't remember my original thought process which led me to believe I didn't need the other packages, but I did. Also, I learned today that you can't always (simply) run vpython calls from the python shell, unless you limit the rate of displaying frames by putting rate() inside a loop.  More on that later, maybe.

I know the above packages have significant overlap (scipy extends numpy, pylab has matplotlib, etc.) but I've used each of those in various forms, so I wanted to be able to call any of them without having to THINK about it.  Done.

Okay, so if you made it this far into this post, you deserve a reward. How about 8 tutorials on scientific python programming? My favorites are the SciPy tutorial and the excellent matplotlib tutorial.

1 comment:

Unknown said...

Hi Andrew,
So I got an academic liscense for canopy and installed it on my machine. I don't want to have canopy be my default python install since I have a bunch of other libraries running and I don't want to sort out all the dependencies. I would like to get VPython running with canopy, but I don't see how to add a package that isn't in the package manager. Is there an easy way to add VPython?