当我在haystack和elasticsearch支持的应用程序中运行“python www.example.com rebuild_index”时遇到了一个问题。manage.py rebuild_index" in my app supported by haystack and elasticsearch.
Python 2.7 Django version 1.6.2 Haystack 2.1.0 Elasticsearch 1.0
请查看出现的错误:
追溯(最近一次调用):在execute_from_command_line(sys. argv)文件"/usr/lib/python2.7/site-packages/django/core/management/init. py ",line 399,in> execute_from_command_line utility. execute()File "/usr/lib/python2.7/site-packages/django/core/management/init. py",第392行,在> execute self中。fetch_command(子命令)。run_from_argv(self. argv)File "/usr/lib/python2.7/site-packages/django/core/management/www.example.com ",line 242,in> run_from_argv self. execute(* args,options.dict)文件"/usr/lib/python2.7/site-packages/django/core/management/www.example.com"manage.pywww.example.com”,第98行,在getitemself中。_connections [key]= load_backend(self. connections_info [key]['ENGINE '])(using = key)File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py ",line 51,in load_backend return import_class(full_backend_path)File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py",line 18,in import_class module_itself = importlib. import_module(module_path)File "/usr/lib/python2.7/site-packages/django/utils/www.example.com ",line 40,in import_moduleimport**(name)File "/usr/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend. py",line 21,in raise MissingDependency("' elasticsearch 'backend requires the installation of' requests'.”)干草堆。例外情况。MissingDependency:base.py", line 242, in >run_from_argv self.execute(*args,**options.dict) File "/usr/lib/python2.7/site-packages/django/core/management/base.py ", line 285, in execute output = self.handle(*args,options) File "/usr/lib/python2.7/site-packages/haystack/management/commands/rebuild_index.py", line 15, in handle call_command('clear_index',options) File "/usr/lib/python2.7/site-packages/django/core/management/init.py", line 159, in call_command return klass.execute(*args,defaults) File "/usr/lib/python2.7/site-packages/django/core/management/base.py ", line 285, in execute output = self.handle(*args,options) File "/usr/lib/python2.7/site-packages/haystack/management/commands/clear_index.py", line 48, in handle backend = connections[backend_name].get_backend() File "/usr/lib/python2.7/site-packages/haystack/utils/ www.example.com ", line 98, ingetitemself._connections[key] = load_backend(self.connections_info[key]['ENGINE'])(using=key) File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py", line 51, in load_backend return import_class(full_backend_path) File "/usr/lib/python2.7/site-packages/haystack/utils/loading.py", line 18, in import_class module_itself = importlib.import_module(module_path) File "/usr/lib/python2.7/site-packages/django/utils/importlib.py ", line 40, in import_moduleimport(name) File "/usr/lib/python2.7/site-packages/haystack/backends/elasticsearch_backend.py", line 21, in raise MissingDependency("The 'elasticsearch' backend requires the installation of 'requests'.") haystack.exceptions.MissingDependency: The 'elasticsearch' backend requires the installation of 'requests'.
我已经安装了运行这些应用程序所需的所有软件包,但是询问请求,它是关于什么的?
3条答案
按热度按时间eeq64g8w1#
就做
mw3dktmi2#
如果你只是通过pip安装requests模块,这个错误应该会消失。
uqzxnwby3#
pip install“elasticsearch>=7,<8”