Reputation: 2555
(windows server 2008 r2) python 34,
I changed settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mydatabase',
'USER': 'mydatabaseuser',
'PASSWORD': 'mypassword',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
1) I run the command:
python manage.py migrate
i get an error: error loading mysqldb module django.core.exception error loading mysqldb
2) I run the command:
pip install mysql -python
get "failed building wheel for mysql-python microsoft visulal c++ 2010 is required unable to find vcvarsall.bat
3) visual c++ 2010 was installed
I have in system variable path to:C:\Python34\Scripts;C:\Python34;
Furthermore i success to run commands from python to mysql (create\read\write table)
what else can i do in order the command python manage.py migrate will work?
Upvotes: 0
Views: 953
Reputation: 2555
Solved by running the following command: pip install mysqlclient
Upvotes: 0
Reputation: 298
You can use mysqlclient , it supports Python3 .You can read about it in django docs.
Upvotes: 1
Reputation: 1285
If
pip install MySQL-python
is failing, you can try
easy_install MySQL-python
.
Also install this: sudo apt-get install python-mysqldb
Upvotes: 0