run manage.py task报错

来源:3-2 配置表单页面

qq_777_3

2019-04-24

Failed to get real commands on module “MxOnline”: python process died with code 1: Traceback (most recent call last):
File “G:\pycharm\PyCharm 2019.1.1\helpers\pycharm_jb_manage_tasks_provider.py”, line 25, in
django.setup()
File “G:\MxOnline\venv\lib\site-packages\django_init_.py”, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File “G:\MxOnline\venv\lib\site-packages\django\apps\registry.py”, line 108, in populate
app_config.import_models()
File “G:\MxOnline\venv\lib\site-packages\django\apps\config.py”, line 202, in import_models
self.models_module = import_module(models_module_name)
File “g:\anaconda2\Lib\importlib_init_.py”, line 37, in import_module
import(name)
File “G:\MxOnline\venv\lib\site-packages\django\contrib\auth\models.py”, line 4, in
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File “G:\MxOnline\venv\lib\site-packages\django\contrib\auth\base_user.py”, line 52, in
class AbstractBaseUser(models.Model):
File “G:\MxOnline\venv\lib\site-packages\django\db\models\base.py”, line 124, in new
new_class.add_to_class(‘meta’, Options(meta, app_label))
File “G:\MxOnline\venv\lib\site-packages\django\db\models\base.py”, line 325, in add_to_class
value.contribute_to_class(cls, name)
File “G:\MxOnline\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 "G:\MxOnline\venv\lib\site-packages\django\db_init
.py", line 33, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “G:\MxOnline\venv\lib\site-packages\django\db\utils.py”, line 211, in getitem
backend = load_backend(db[‘ENGINE’])
File “G:\MxOnline\venv\lib\site-packages\django\db\utils.py”, line 115, in load_backend
return import_module(’%s.base’ % backend_name)
File “g:\anaconda2\Lib\importlib_init_.py”, line 37, in import_module
import(name)
File “G:\MxOnline\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?

python版本27 django1.9 也安装了mysqlclient(虽然也显示安装成功,但是还是产生以上提示)setting文件中也已配置mysql 不知道是什么问题?

写回答

1回答

Ethreal

2019-04-24

你pycharm运行的环境和你安装库的环境是同一个么?

0
3
qq_777_3
非常感谢!
2019-04-25
共3条回复

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4038 问题

查看课程