为什么python包从不同的索引url安装到pip?

时间:2022-06-28 18:38:00

I noticed on this page https://anaconda.org/pypi/urllib3 that the pip command to install the package was slightly different than normal:

我注意到在这个页面https://anaconda.org/pypi/urllib3, pip命令安装包的方式与正常情况略有不同:

pip install -i https://pypi.anaconda.org/pypi/simple urllib3

Digging a bit through pip's help I figured out the following which basically says that things are usually installed from https://pypi.python.org/simple.

通过pip的帮助,我找到了下面的内容,基本上说,这些东西通常是从https://pypi.python.org/simple中安装的。

Why is there a separate Python repository that Anaconda uses? I would've expected that you simply pip install anything but this seems to suggest there is a level of choice between the following two.

为什么会有一个单独的Python库,而Anaconda使用?我希望您只是简单地安装了任何东西,但这似乎表明在以下两个方面有一定的选择。

  1. https://pypi.python.org/simple
  2. https://pypi.python.org/simple
  3. https://pypi.anaconda.org/pypi/simple

    https://pypi.anaconda.org/pypi/simple

    Package Index Options (including deprecated options): -i, --index-url Base URL of Python Package Index (default https://pypi.python.org/simple). This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.

    包索引选项(包括不推荐的选项):-i,—Python包索引的索引URL基URL(默认https://pypi.python.org/simple)。这应该指向一个符合PEP 503(简单的存储库API)或以相同格式布局的本地目录的存储库。

1 个解决方案

#1


0  

Why is there a separate Python repository that Anaconda uses?

为什么会有一个单独的Python库,而Anaconda使用?

Because Continuum IO (the maintainers of conda and Anaconda) decided that they wanted to have their own pip repository, I suppose. As far as I know, there's no difference between the two, except that possibly some package versions are different between the two repositories, or perhaps one repository has some packages that aren't present in the other.

因为连续IO (conda和Anaconda的维护者)决定他们希望拥有自己的pip存储库。据我所知,这两者之间没有区别,除了可能一些包版本在两个储存库之间是不同的,或者一个存储库中有一些不存在于另一个存储库中的包。

In any case, in my experience, the pip that's installed by default with Anaconda searches the https://pypi.python.org/simple repository by default, and one has to manually include the -i option to get to the Anaconda pip repository.

在任何情况下,根据我的经验,默认情况下安装的pip会在默认情况下搜索https://pypi.python.org/simple存储库,并且必须手动地包含-i选项,以到达Anaconda pip存储库。

#1


0  

Why is there a separate Python repository that Anaconda uses?

为什么会有一个单独的Python库,而Anaconda使用?

Because Continuum IO (the maintainers of conda and Anaconda) decided that they wanted to have their own pip repository, I suppose. As far as I know, there's no difference between the two, except that possibly some package versions are different between the two repositories, or perhaps one repository has some packages that aren't present in the other.

因为连续IO (conda和Anaconda的维护者)决定他们希望拥有自己的pip存储库。据我所知,这两者之间没有区别,除了可能一些包版本在两个储存库之间是不同的,或者一个存储库中有一些不存在于另一个存储库中的包。

In any case, in my experience, the pip that's installed by default with Anaconda searches the https://pypi.python.org/simple repository by default, and one has to manually include the -i option to get to the Anaconda pip repository.

在任何情况下,根据我的经验,默认情况下安装的pip会在默认情况下搜索https://pypi.python.org/simple存储库,并且必须手动地包含-i选项,以到达Anaconda pip存储库。