我想在django中使用搜索库
所以我决定使用django-watson(告诉我安装简单,使用方便)
我命令
git clone https://github.com/etianen/django-watson.git
在我的django项目中
并在watson
settings.py. INSTALLED_APPS
当我命令
时python manage.py migrate
django无法找到watson
所以我决定卸载django-watson
并重新安装
我命令
rm -rf django-watson
和命令migrate
(检查我何时卸载库迁移没有问题)
python manage.py migrate
突然它显示我的错误
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute
django.setup()
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/hanminsoo/.pyenv/versions/study_alone/lib/python3.5/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/Users/hanminsoo/.pyenv/versions/3.5.1/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'django-watson'
我认为它已安装在环境中,但我无法找到django-watson
我想清楚地删除django-watson
请有人帮助我
答案 0 :(得分:1)
确保您已将其从settings.py中的INSTALLED_APPS中删除,并且已删除项目中与其相关的所有导入。
答案 1 :(得分:0)
如上所述,您必须从已安装的应用中删除django-watson
。但这是最初的错误:要安装watson,您必须将watson
添加到INSTALLED_APPS
,而不是django-watson
。 This is well explained in the documentation:
- 使用pip安装django-watson:pip install django-watson。
- 添加&#39; watson&#39;到您的INSTALLED_APPS设置。
醇>