gpt4 book ai didi

solr - 无法 pip 安装 SolrClient(python2.6 与 3.4 的问题?)

转载 作者:行者123 更新时间:2023-12-04 19:37:36 27 4
gpt4 key购买 nike

我正在尝试 pip install SolrClient ,而且我相信我的 python 版本有些困难。

这是错误消息。

[root@centos64 ~]# pip install SolrClient
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting SolrClient
Using cached SolrClient-0.1.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-UeQsqQ/SolrClient/setup.py", line 4, in <module>
import SolrClient
File "SolrClient/__init__.py", line 1, in <module>
from .solrclient import SolrClient
File "SolrClient/solrclient.py", line 10, in <module>
from .collections import Collections
File "SolrClient/collections.py", line 7, in <module>
from collections import defaultdict
ImportError: cannot import name defaultdict

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-UeQsqQ/SolrClient/

所以,当我去检查我的python版本时,它是2.6
[root@centos64 ~]# python -V
Python 2.6.6

我的机器上有 python 3.4,尽管我需要这样称呼它
[root@centos64 ~]# python3.4 -V
Python 3.4.3

所以,有几个问题。

我是否正确假设我的错误是由于我试图使用 python2.6 进行 pip 安装?

如果是这样,我该怎么做

a) 告诉 pip 使用 python3.4 版本? (不确定这是否是正确的思考方式)

b) 调整我的系统以使用 python3.4

否则,我不确定如何在此处进行。想法?

最佳答案

我确实需要使用 python3.4

正如建议的那样,我为该任务使用了一个虚拟环境。

pip install pew

pew new -p `which python3.4` 3.4

pew workon 3.4

pip install SolrClient

关于solr - 无法 pip 安装 SolrClient(python2.6 与 3.4 的问题?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37201356/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com