安装完mysql-python后运行task还是报错
来源:3-2 配置表单页面
慕UI3396178
2018-09-21
Failed to get real commands on module “djangostart”: python process died with code 1: Traceback (most recent call last):
File “E:\pycharm\PyCharm 2018.2.3\helpers\pycharm_jb_manage_tasks_provider.py”, line 25, in
django.setup()
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django_init_.py”, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\apps\registry.py”, line 108, in populate
app_config.import_models()
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\apps\config.py”, line 202, in import_models
self.models_module = import_module(models_module_name)
File “c:\python27\Lib\importlib_init_.py”, line 37, in import_module
import(name)
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\contrib\auth\models.py”, line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\contrib\auth\base_user.py”, line 52, in
class AbstractBaseUser(models.Model):
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\models\base.py”, line 124, in new
new_class.add_to_class(‘meta’, Options(meta, app_label))
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\models\base.py”, line 325, in add_to_class
value.contribute_to_class(cls, name)
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\models\options.py”, line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db_init.py", line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\utils.py”, line 211, in getitem
backend = load_backend(db[‘ENGINE’])
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\utils.py”, line 115, in load_backend
return import_module(’%s.base’ % backend_name)
File “c:\python27\Lib\importlib_init_.py”, line 37, in import_module
import(name)
File “C:\Users\asus\PycharmProjects\djangostart\venv\lib\site-packages\django\db\backends\mysql\base.py”, line 30, in
‘Did you install mysqlclient or MySQL-python?’ % e
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb.
Did you install mysqlclient or MySQL-python?
1回答
-
慕UI3396178
提问者
2018-09-21
自己解决了,估计是virtual的安装错误,重新创建了一个项目,具体细节就不讲了,然后就可以用Mysql-python 了
012018-09-25
相似问题