【发布时间】:2021-10-06 21:45:27
【问题描述】:
我假设 pip 和 conda 尽管存在差异,但它们都是包管理器并检查环境中安装的包的一致性!不过,就我而言,我有一个 requirements.txt 列表,位于 python=3.6 之上。在我的 conda 虚拟环境中,我一一安装了它们。奇怪的是,当在 anaconda.org 频道中找到一些软件包并使用 conda install 安装它们时,conda 会抱怨!例如,当我尝试安装 statistics=1.0.3.5 时,我在终端上收到此消息:
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- statistics=1.0.3.5 -> python[version='2.7.*|<3|>=2.7,<2.8.0a0']
Your python: python=3.6
但是,当我使用 pip 时,它起作用了!
为什么会这样?
我会在使用这个包的过程中遇到问题吗?
我阅读了这个 Stackoverflow post 关于 pip 和 conda 之间的区别,并试图从 doc 中理解它(虽然没有那么成功)。
【问题讨论】:
-
请注意,
statistics包是 Python 3.4 中引入的the standard library module 的反向移植。它仅设计为安装在 Python 2 中,因为它已经是 Python 3.4+ 的一部分,即看起来 Conda 工作正常。不知道通过 Pip 安装它的后果是什么。