尝试对项目使用 Elasticsearch 。
from elasticsearch import Elasticsearch
es = Elasticsearch(
"https://example.com",
http_auth=("abc", "bcd"),
)
但是出现错误:
ValueError: URL must include a 'scheme', 'host', and 'port' component (ie 'https://localhost:9200')
我在 Pycharm CE 上运行它并创建了 Python 3.9 的虚拟环境。
我应该使用不同版本的 Python 来完成这项工作吗?
此外,我已经尝试过 pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1
但无济于事。
最佳答案
我遇到了同样的错误。安装 ES 版本 7.17 解决了这个问题。我在 pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1
上也遇到了不可用问题。尝试使用下一个可用版本 (0.8.28.0) 并意识到它正在将 elasticsearch
降级到 7.17。
所以试试pip install elasticsearch==7.17
。
关于elasticsearch - ValueError : URL must include a 'scheme' , 'host' 和 'port' 组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73512557/