Category Archives: python

pip is broken with AttributeError: ‘module’ object has no attribute ‘SSL_ST_INIT’

This error is quite frustrating, and it has been occurring to me when I try to move old django sites to a new server. It is frustrating because once this happens, your pip is broken and you can’t do anything … Continue reading

Posted in Linux, Mac OS X, python, SSL | Comments Off on pip is broken with AttributeError: ‘module’ object has no attribute ‘SSL_ST_INIT’

OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’

After upgrading some things using homebrew, this error started coming up on a coworker’s machine when he tried to pip install virtualenvwrapper. This error was coming up right before the operation not permitted: Installing collected packages: six Found existing installation: … Continue reading

Posted in Mac OS X, python | Comments Off on OSError: [Errno 1] Operation not permitted: Extras/lib/python/six-1.4.1-py2.7.egg-info’

ImportError: cannot import name sanitizer when trying to run django

I hope this saves you a couple hours of headaches that I experienced recently. If you get the dreaded error: from html5lib import sanitizer, serializer, treebuilders, treewalkers ImportError: cannot import name sanitizer Never fear. The fix is easy once you … Continue reading

Posted in django, python, Web Programming | Comments Off on ImportError: cannot import name sanitizer when trying to run django

KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

If you’re getting an error like this: … in reverse_dict return self._reverse_dict[language_code] KeyError: ‘en-us’ If your urls.py file contains a reverse() call, that is the reason.  You’re calling reverse before all the urls are loaded and everything is ready.  You … Continue reading

Posted in django, python, Web Programming | Comments Off on KeyError: ‘en-us’ when doing a reverse() lookup in urls.py

How to install mysqldb for python on Mac OSX

Install XCode and the command line tools Install homebrew brew install mysql-connector-c pip install mysql-python

Posted in Mac OS X, python | Comments Off on How to install mysqldb for python on Mac OSX