gpt4 book ai didi

mysql - Django/MySQL 错误

转载 作者:行者123 更新时间:2023-11-29 13:43:26 24 4
gpt4 key购买 nike

我遇到此错误,但不知道如何修复它。我查了一些以前的问题,有的说是因为没有安装MySQL-python。不过我确实安装了

    Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/core/management/sql.py", line 9, in <module>
from django.db import models
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__
backend = load_backend(db['ENGINE'])
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/utils.py", line 27, in load_backend
return import_module('.base', backend_name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /home/bradford/Development/Django/django_1.5.1/local/lib/python2.7/site-packages/_mysql.so: wrong ELF class: ELFCLASS32

最佳答案

尝试

sudo apt-get install python-mysqldb

关于mysql - Django/MySQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17779761/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com