N3mo
N3mo

Reputation: 1393

installing Django's mysql module

I am using a virtual environment with python 3.3 after setting this up I used pip to install Django. I started a project and configured the setting.py but after I run "python3.3 manage.py syncdb" I got the following error:

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'

I read online that this means that MySQL-python is not installed so I tried to install it with pip

Downloading/unpacking MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py egg_info for package MySQL-python
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/build/MySQL-python/setup.py", line 13, in <module>
    from setup_posix import get_config
  File "./setup_posix.py", line 2, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>

File "/build/MySQL-python/setup.py", line 13, in <module>

from setup_posix import get_config

 File "./setup_posix.py", line 2, in <module>

from ConfigParser import SafeConfigParser

ImportError: No module named 'ConfigParser'

----------------------------------------
Cleaning up...

and after this I went online and I found out that ConfigParser in python3.3 has been renamed so apparently this is not going to work. Can anybody help me solve this problem and run Django ?! or suggest a different way of making Django work?

Upvotes: 1

Views: 2399

Answers (2)

DiA
DiA

Reputation: 369

Try to install PyMysql
https://github.com/PyMySQL/PyMySQL
Maybe this question will help:
connecting mysql and python3.3

Upvotes: 1

lanzz
lanzz

Reputation: 43208

The MySQL-python module does not support Python 3.x:

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release. PyPy is supported.

Note that the MySQL-python module is discontinued and receives only maintenance updates, so the promise of Python 3 support in a future release is obsolete and not expected to happen.

Upvotes: 3

Related Questions