ImportError: No module named pysqlite2

Currently my favorite web app environment includes:

  • CentOS 5.5
  • Python 2.6 (built from source)
  • Pylons 1.0 (w/ SQLAlchemy 0.5.8)
  • nginx

Whenever I setup a new environment, and execute “paster serve –reload development.ini” for the first time, I always get a stack trace from SQLAlchemy that ends with the following error message:

ImportError: No module named pysqlite2

And it always takes me a few minutes to figure out how to fix it again. So I’m taking a few minutes to jot it down here so I don’t forget again!

yum install sqlite-devel -y
easy_install pysqlite

2 thoughts on “ImportError: No module named pysqlite2

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">