Forums

Error in installing mysqldb module?

Traceback (most recent call last): File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 15, in <module> import MySQLdb as Database ImportError: No module named 'MySQLdb'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/prudhvinikku/prudhvinikku.pythonanywhere.com/aseii/manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/init.py", line 381, in execute_from_command_line utility.execute() File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/core/management/init.py", line 357, in execute django.setup() File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/apps/registry.py", line 112, in populate app_config.import_models() File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 985, in _gcd_import File "<frozen importlib._bootstrap>", line 968, in _find_and_load File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 697, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/prudhvinikku/prudhvinikku.pythonanywhere.com/aseii/CREW/models.py", line 6, in <module> class user(models.Model): File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/models/base.py", line 101, in new new_class.add_to_class('_meta', Options(meta, app_label)) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/models/base.py", line 305, in add_to_class value.contribute_to_class(cls, name) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/models/options.py", line 203, in contribute_to_class self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/init.py", line 33, in getattr return getattr(connections[DEFAULT_DB_ALIAS], item) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/utils.py", line 202, in getitem backend = load_backend(db['ENGINE']) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/utils.py", line 110, in load_backend return import_module('%s.base' % backend_name) File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 985, in _gcd_import File "<frozen importlib._bootstrap>", line 968, in _find_and_load File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 697, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 20, in <module> ) from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient? Traceback (most recent call last): File "/home/prudhvinikku/.local/bin/pa_autoconfigure_django.py", line 52, in <module> main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke')) File "/home/prudhvinikku/.local/bin/pa_autoconfigure_django.py", line 42, in main project.run_collectstatic() File "/home/prudhvinikku/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 87, in run_collectstatic '--noinput', File "/usr/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/prudhvinikku/.virtualenvs/prudhvinikku.pythonanywhere.com/bin/python', '/home/prudhvinikku/prudhvinikku.pythonanywhere. com/aseii/manage.py', 'collectstatic', '--noinput']' returned non-zero exit status 1.

Can someone help?

do you have mysqlclient installed in your virtualenv?