Python 2.5 "ImportError: No module named _md5" on OS X

If you are getting an error complaining about missing md5 running python 2.5 on OS X : Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/dave/Desktop/setuptools-0.6c9-py2.5.egg/setuptools/command/", line 21, in <module> File "/Users/dave/Desktop/setuptools-0.6c9-py2.5.egg/setuptools/", line 2, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/", line 91, in <module> import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/", line 133, in <module> md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5 … you need to install py25-hashlib :...

June 6, 2009 · 1 min · Dave Perrett

python 2.5 zipimport.ZipImportError on OS X

If you are getting an error similar to the following trying to run pythin2.5 on OS X : zipimport.ZipImportError: can't decompress data; zlib not available … you need to install py25-zlib : > sudo port install py25-zlib

June 6, 2009 · 1 min · Dave Perrett

iTerm Delete Key Config

I’ve often found that after SSHing with iTerm, the delete key mappings are occasionally (well regularly) problematic. This post from Alaska Geeks sorted the problem out straight away in my case : ...

October 24, 2008 · 1 min · Dave Perrett

Browser detection with PHP

You can use PHP’s get_browser() function to find out information about user’s browsers, but it takes a little setting up. ...

June 23, 2008 · 2 min · Dave Perrett

PHP5 on OS X Leopard

PHP5 is already installed on Leopard by default - all you have to do is turn it on. First, turn on web sharing - go to System Preferences->Sharing and make sure the ‘Web Sharing’ option is turned on. ...

June 23, 2008 · 1 min · Dave Perrett

OS X zsh shell config

Here’s a zsh shell configuration file for OS X, based almost entirely on a post at Fried CPU . All i changed was the ls and ll aliases because Fried’s didn’t work for me. To use it, save it in a file called .zshrc in your home directory. You might also want to set zsh as your default shell . ...

July 25, 2007 · 4 min · Dave Perrett

Set OS X Default Shell

You need to use Niutl to change your shell. In the terminal : $ sudo niutil -createprop . /users/dave shell /bin/zsh Alternatively, you can use the NetInfo Manager utility (in the Utilities folder). Select your user in the navigator, and change the value of the shell property. ...

July 25, 2007 · 1 min · Dave Perrett

Cocoa drag to dock to open

Go to Project->Edit Active Target->Properties (Tab) and enter the filetypes that you want your dock icon to respond to : ...

April 13, 2007 · 1 min · Dave Perrett

Quit cocoa app on window close

Add this method to your NSWindowController : -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { return YES; }

April 13, 2007 · 1 min · Dave Perrett

Compile LibTorrent on OSX

Before you do anything, install darwinports , and then use it to install boost : ...

April 2, 2007 · 1 min · Dave Perrett