ImportError: No module named validators
来源:5-2 xadmin的安装
幕布斯9381828
2017-07-25
xadmin 安装之后 代码运行不了
然后是版本问题 我把django换成1.9的之后
就出现这个问题
System check identified no issues (0 silenced). Unhandled exception in thread started by <function wrapper at 0x10d2e37d0> Traceback (most recent call last): File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check_migrations() File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 163, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__ self.loader = MigrationLoader(self.connection) File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__ self.build_graph() File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/db/migrations/loader.py", line 170, in build_graph self.load_disk() File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/site-packages/django/db/migrations/loader.py", line 105, in load_disk migration_module = import_module("%s.%s" % (module_name, migration_name)) File "/Users/tianxiaoqiang/Applications/anaconda/envs/django/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Users/tianxiaoqiang/Life/GitHub/DjangoLMS/apps/users/migrations/0001_initial.py", line 6, in <module> import django.contrib.auth.validators ImportError: No module named validators
写回答
3回答
-
幕布斯9381828
提问者
2017-07-26
根据报错的最后提示:
File "/Users/tianxiaoqiang/Life/GitHub/DjangoLMS/apps/users/migrations/0001_initial.py", line 6, in <module> import django.contrib.auth.validators ImportError: No module named validators
是在这里“apps/users/migrations/0001_initial.py”出了问题,
把数据库tables全部删除了,然后把apps/users/migrations/00** 都给删除了,然后重新makemigration和migrate
我觉得是因为我之前用的djnago1.11版本,现在切换到1.9版本了,然后之前的makemigration和migrate和django1.9的有不同,导致这样的
122017-07-26 -
传说中的小白龙
2017-07-30
我跟你一样。问题解决了吗?
012017-07-31 -
幕布斯9381828
提问者
2017-07-25
我尝试了 还是不行
pip install validator pip install validators
pip list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. decorator (4.1.2) Django (1.9) django-crispy-forms (1.6.1) django-formtools (2.0) httplib2 (0.9.2) List (1.3.0) MySQL-python (1.2.5) olefile (0.44) Pillow (4.2.1) pip (9.0.1) pytz (2017.2) setuptools (27.2.0) six (1.10.0) validator (2.0.6) validators (0.12.0) wheel (0.29.0) xadmin (0.6.1)
00
相似问题