PyEphem available for Windows!
November 9th, 2007
Over the years I have received many requests from frustrated Windows users, asking for a Windows-native version of my PyEphem astronomy library for Python. For most Windows users, an attempt to build the extension ends abruptly with the terrible and famous message:
error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed.And, as I myself do not have Visual Studio on the small Windows machine that I deign to own for the sake of my photo printer, I have never been able to offer my users much help. But earlier this year, a helpful PyEphem user named Jeff Kowalczyk emailed me a link to Philip von Weitershausen's post “Cheap binary Windows eggs”, which describes a method for building Python extensions using a freely available compiler. Aside from the difficulty that the Python setuptools ignored the pydistutils.cfg file he recommended, making it necessary for me to name the compiler on the command line, his instructions produced a PyEphem windows egg with only a few steps:
- I installed Python for Windows.
- I installed the setuptools package using its Windows .exe installer (scroll down the page to find it).
- I installed the MinGW compiler.
- I installed LibArchive for Windows.
- I added to my Windows Path:
C:\Python25;C:\MingW\bin;C:\Program Files\GnuWin32\bin
- I downloaded the PyEphem source archive.
- I brought up a command window and ran:
C:\dev> bsdtar -xf pyephem-3.7.2.1.tar.gz C:\dev> cd pyephem-3.7.2.1 C:\dev\pyephem-3.7.2.1> python setup.py build --compiler=mingw32 C:\dev\pyephem-3.7.2.1> python setup.py bdist_egg
- I uploaded the egg in the dist directory to the Cheese Shop.
Posted:
Friday, November 9th, 2007 at 11:10 am
Categories: Computing, PyEphem, Python
If you respond on your own blog, trackback to this entry!