Monthly Archives: August 2010

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
wget peak.telecommunity.com/dist/ez_setup.py
python2.6 ez_setup.py
easy_install pysqlite
Share
PG

About the author

Jamie Begin (@rbn_jamie) is founder and systems architect at RightBrain Networks, a software consultancy and managed services provider that specializes in Amazon Web Services. He is an AWS Certified Systems Architect, regularly speaks and writes on AWS best practices and DevOps in the cloud, and is the host of the regional user group, AWS Michigan. Jamie lives near Ann Arbor, Michigan with his wife, Amy, and two children, Elise and Henry.