安装django-haystack遇到的问题
1.Haystack介绍
Haystack 是在Django中对接搜索引擎的框架,搭建了用户和搜索引擎之间的沟通桥梁。我们在Django中可以通过使用 Haystack 来调用 Elasticsearch 搜索引擎。Haystack 可以在不修改代码的情况下使用不同的搜索后端
2.Haystack安装
今天又遇到了安装包的问题,本来很简单的安装,可是我的ubuntu系统又有问题了,
首先来看,正常情况下,
$ pip install django-haystack
$ pip install elasticsearch==2.4.1
问题1: pip install 错误
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProtocolError(‘Connection aborted.’, ConnectionResetError(104, ‘连接被对方重设’))’: /simple/elasticsearch/
解决:使用镜像源下载,常见的镜像源有:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
问题2: 安装django-haystack出错![在这里插入图片描述](https://img-blog.csdnimg.cn/2021041510493162.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwMDA2NzYw,size_16,color_FFFFFF,t_70)
最后,将我的django 1.11.11降了版本才安装成功,但与我的redis版本冲突,于是卸载了重装,
查找资料发现django=1.11.11可对应django-haystack==2.7.0
结果还是不成功解决:
$ pip install setuptools-scm -i https://pypi.tuna.tsinghua.edu.cn/simple/
再安装django-haystack==2.7.0成功