conda 安装 psycopg2 时出现错误。

10

新的MackBookPro运行Catalina操作系统。使用Homebrew安装了Anaconda。尝试使用命令conda install -c anaconda psycopg2安装psycopg2,但是由于软件包冲突而失败。以下是安装尝试的部分输出内容:

$ conda install -c anaconda psycopg2
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                \ 

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package six conflicts for:
pyopenssl -> cryptography[version='>=2.8'] -> six[version='>=1.4.1']
pytest-doctestplus -> pytest[version='>=3.0'] -> six[version='>=1.10.0']
python-dateutil -> six[version='>=1.5']
nltk -> six

有什么想法或如何修复?

conda update conda,然后尝试执行。 - sahasrara62
谢谢。我尝试过这个,然后再次运行了安装命令。没有成功 :( - Brian Addison
2个回答

6
可能原因是[anaconda==2020.02]和[70+ PACKAGES]之间存在太多冲突。尝试以下步骤适用于我:
1. conda -V 2. conda update -n base conda
确保您的版本为conda 4.8.2,然后运行以下命令:
3. conda update --all
这将导致以下软件包降级:
anaconda 2020.02-py37_0 --> custom-py37_1
接下来运行以下命令:
4. conda install psycopg2
这将安装libpq、psycopg2,更新某些软件包,有些软件包可能会被更高优先级的通道取代。

4
正确的命令是conda update --all - Abdel-Raouf
只需运行conda update --all即可解决我的问题。顺便提一下! - lizardfireman

0
今天我遇到了完全相同的情况,使用conda包管理器无法安装psycopg2。但是当我尝试在Anaconda提示符中使用pip进行相同操作时,安装非常顺利,只用了不到一分钟:
pip install psycopg2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接