Django Windows Error Loading Mysqldb Module No Module Named Mysqldb
Contents |
here for a quick overview of the site Help Center importerror: no module named 'configparser' Detailed answers to any questions you might have Meta Discuss importerror no module named 'mysqldb' python 3 the workings and policies of this site About Us Learn more about Stack Overflow raise improperlyconfigured("error loading mysqldb module: %s" % e) the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x error loading mysqldb module: no module named mysqldb mac Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting “Error loading MySQLdb module: No module named MySQLdb” - have tried previously posted solutions up vote 219
No Module Named Mysqldb Windows
down vote favorite 58 This is a much discussed issue for OSX 10.6 users, but I haven't been able to find a solution that works. Here's my setup: Python 2.6.1 64bit Django 1.2.1 MySQL 5.1.47 osx10.6 64bit I create a virtualenvwrapper with --no-site-packages, then installed Django. When I activate the virtualenv and run python manage.py syncdb, I get this error: Traceback (most recent call last): File "manage.py", line 11, in
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this
Environmenterror: Mysql_config Not Found
site About Us Learn more about Stack Overflow the company Business Learn more fatal error c1083: cannot open include file: 'config-win.h': no such file or directory about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x no module named mysqldb sqlalchemy Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Python3 + http://stackoverflow.com/questions/2952187/getting-error-loading-mysqldb-module-no-module-named-mysqldb-have-tried-pre MySql: Error loading MySQLdb module: No module named 'MySQLdb' up vote 8 down vote favorite 3 I am new to Python and trying to setup a Django project to work with MySql. I have read through the documentation as well as some other StackOverflow posts about the topic, but I still can't get it to work. When I try to run a migrate in Django http://stackoverflow.com/questions/26560973/python3-mysql-error-loading-mysqldb-module-no-module-named-mysqldb I get the following error: Error loading MySQLdb module: No module named 'MySQLdb' I have installed the recommended MySql Python Connector (2.0.1) selecting Ubuntu (since I am on Mint Linux). It installs correctly. I still get the error. I don't need to add this library to the project or anything, right? It looks like python should just be aware of this and run successfully. What can I do? Thanks. EDIT: I forgot to mention: I am running Python 3.4 - a lot of typical solutions are still using 2.7, so they don't work and all the solutions with 3.0 I have tried without success. python mysql django mysql-python share|improve this question asked Oct 25 '14 at 9:24 skaz 8,123154781 I had luck using: github.com/nakagami/django-cymysql But I would prefer to use the "official" connector. Or am I thinking about this wrong? –skaz Oct 25 '14 at 9:32 There are a lot of similar questions here "python3 mysql" stackoverflow.com/search?q=python3+mysql I recommend you try github.com/davispuh/MySQL-for-Python-3 –madzohan Oct 25 '14 at 9:52 possible duplicate of Can I use MySQL on Django(dev 1.6.x) with Python3.x? –madzohan Oct 25 '14 a
here for a quick http://stackoverflow.com/questions/15312732/django-core-exceptions-improperlyconfigured-error-loading-mysqldb-module-no-mo overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://aarvik.dk/how-to-get-started-with-django-on-top-of-python-3-4-mysql-mariadb-5-5/ of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads no module with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign no module named up django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb up vote 48 down vote favorite 10 The problem Im facing while trying to connect to database for mysql. I have also given the database settings that i have used. Traceback (most recent call last): File "manage.py", line 10, in
framework. Here is how you get started with newer version of MySQL and Python. Vagrant (optional) Eventually start out with a fresh VM (Ubuntu + Python3 environment) with this Vagrant box: https://github.com/adionditsak/vagrant-python-env Basics Create a new Python 3.4 isolated environment with Virtualenv (https://virtualenv.pypa.io/en/latest/): $ virtualenv-3.4 djangoenv Activate the new Python environment (djangoenv): $ source djangoenv/bin/activate Install django lib with pip: $ pip install django Install mariadb version 5.5: $ apt-get install mariadb-server-5.5 Test if django is installed properly: $ python -c "import django; print(django.get_version())" Check if Python and MySQL versions are correct: $ mysql -V mysql Ver 15.1 Distrib 5.5.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 $ python -V Python 3.4.0 Start your new django project: $ django-admin startproject mysite MySQL Engine Run runserver or migrate command: $ python manage.py migrate $ python manage.py runserver 8080 You will see the following error: ... django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb' ... If you read the documentation, you will see that the native MySQLdb driver doesn't support Python 3. The trick is to use the mysql.connector instead. Read more in the documentation: https://docs.djangoproject.com/en/1.7/ref/databases/#mysql-db-api-drivers Change the ENGINE to mysql.connector.django in your project settings(.py): $ vi mysite/mysite/settings.py: .... 77 DATABASES = { 78 'default': { 79 'NAME': 'djangotest', 80 'ENGINE': 'mysql.connector.django', 81 'HOSTNAME': 'localhost', 82 'USER': 'root', 83 'PASSWORD': 'testtest123!', 84 'OPTIONS': { 85 'autocommit': True, 86 }, 87 } 88 } ... Now try again to create neccessary db stuff for the default APPS in Django: $ python manage.py migrate August 14, 2015 - 08:12:20 Django version 1.8.3, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. ^C(djangovirtualenv)root@vagrant-ubuntu-trusty-64:~/mysite# python manage.py migrate Operations to perform: Synchronize unmigrated apps: staticfiles, messages Apply all migrations: auth, sessions, admin, co