0

Getting started with Django 1.3.1 and Upon running

python manage.py syncdb

with Python 2.6. I keep getting an error loading mysqldb module: No module named mysqldb message. I have tried doing sudo yum install python-mysql and sudo yum install python-mysqldb

on a CentOS 5 system but I get a "no package found" message and the error persists in django.

What's the fix for this? I would like to keep the Python version as 2.6 to preserve other dependencies so reinstalling 2.5 or something is out of the question.

Thanks!

algorithmicCoder
  • 6,595
  • 20
  • 68
  • 117

2 Answers2

0

There's no point using the system packaging tools if you're using a different Python version to the one provided by the system. You'll have to use the Python packaging tools instead - eg easy_install mysqldb.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
0

If you are just getting started with Django you should really take a look at virtualenv and pip.

This article gives a good overview: http://www.clemesha.org/blog/modern-python-hacker-tools-virtualenv-fabric-pip

You can even specify the python version for your virtual python environments.

And last but not least a good guide on how to get mysql running with virtualenv: http://www.saltycrane.com/blog/2010/02/install-mysqldb-virtualenv-ubuntu-karmic/

Community
  • 1
  • 1
arie
  • 18,737
  • 5
  • 70
  • 76