pip:python twisted包不从indexu安装

2024-06-26 13:32:37 发布

您现在位置:Python中文网/ 问答频道 /正文

背景

我有一个名为https://pipmirror.company.com的内部pypi镜像,我的pip.conf配置如下

$ cat ~/.config/pip/pip.conf
[global]
index-url = https://pipmirror.company.com/simple
cert = /etc/pki/tls/cert.pem
log = /home/hanxuel/.config/pip/pip.log
bash-4.2$ cat incremental-pip.log |xclip

Pypi上的所有包都是镜像的。你知道吗

扭曲/增量包

当我安装Twisted包时,我特别相信incremental依赖关系,pip将尝试从https://pypi.python.org而不是https://pipmirror.company.com获取

2019-07-24T10:43:10 Collecting Twisted>=13.1.0; python_version != "3.4" (from scrapy)
2019-07-24T10:43:10   1 location(s) to search for versions of Twisted:
2019-07-24T10:43:10   * https://pipmirror.company.com/simple/twisted/
2019-07-24T10:43:10   Getting page https://pipmirror.company.com/simple/twisted/
2019-07-24T10:43:10   Analyzing links from page https://pipmirror.company.com/simple/twisted/
2019-07-24T10:43:10     Skipping link https://pipmirror.company.com/packages/48/55/c2e3f83516f4b78499e19da801d337ff03b103c9e6de4b342199deaa2281/Twisted-19.2.0-cp27-cp27m-win_amd64.whl#sha256=3716eca1c80ef88729a85e9a70f09acce8df2adf7c58590d54c94f383945bc47 (from https://pipmirror.company.com/simple/twisted/); it is not compatible with this Python
2019-07-24T10:43:10     Found link https://pipmirror.company.com/packages/f8/2b/a80a70f71eb2b86992ffa5aaae41457791ae67faa70927fd16b76127c2b7/Twisted-19.2.0.tar.bz2#sha256=1708e1928ae84ec9d3ebab0d427e20e1e38ff721b15bbced476d047d4a43abbe (from https://pipmirror.company.com/simple/twisted/), version: 19.2.0
2019-07-24T10:43:10     Found link https://pipmirror.company.com/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from https://pipmirror.company.com/simple/twisted/), version: 19.2.1
2019-07-24T10:43:10   Using version 19.2.1 (newest of versions: 19.2.0, 19.2.1)
2019-07-24T10:43:10   Created temporary directory: /tmp/pip-unpack-jbgp3v1j
2019-07-24T10:43:10   Downloading https://pipmirror.company.com/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2 (3.1MB)
2019-07-24T10:43:10   Downloading from URL https://pipmirror.company.com/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from https://pipmirror.company.com/simple/twisted/)
2019-07-24T10:43:12   Added Twisted>=13.1.0; python_version != "3.4" from https://pipmirror.company.com/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from scrapy) to build tracker '/tmp/pip-req-tracker-y8w02b9g'
2019-07-24T10:43:12     Running setup.py (path:/tmp/pip-install-_1o7olfy/Twisted/setup.py) egg_info for package Twisted
2019-07-24T10:43:12     Running command python setup.py egg_info
2019-07-24T10:43:13     Download error on https://pypi.org/simple/incremental/: [Errno 104] Connection reset by peer -- Some packages may not be found!
2019-07-24T10:43:13     Couldn't find index page for 'incremental' (maybe misspelled?)
2019-07-24T10:43:13     Download error on https://pypi.org/simple/: [Errno 104] Connection reset by peer -- Some packages may not be found!
2019-07-24T10:43:13     No local packages or working download links found for incremental>=16.10.1
2019-07-24T10:43:13     Traceback (most recent call last):
2019-07-24T10:43:13       File "<string>", line 1, in <module>
2019-07-24T10:43:13       File "/tmp/pip-install-_1o7olfy/Twisted/setup.py", line 20, in <module>
2019-07-24T10:43:13         setuptools.setup(**_setup["getSetupArgs"]())
2019-07-24T10:43:13       File "/home/hanxuel/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
2019-07-24T10:43:13         _install_setup_requires(attrs)

查看Gist for pip install problem的完整日志

如何确保所有软件包都是从pipmirr.company.com? 你知道吗

更新1

新创建的用户帐户上的确切pip命令

$ pip install --user -i https://pipmirror.company.com/simple --cert /etc/pki/tls/cert.pem Twisted
Looking in indexes: https://pipmirror.company.com/simple
Collecting Twisted
  Downloading https://pipmirror.company.com/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2 (3.1MB)

    100% |████████████████████████████████| 3.1MB 5.0MB/s 
Complete output from command python setup.py egg_info:
Download error on https://pypi.org/simple/incremental/: [Errno 101] Network is unreachable -- Some packages may not be found!
Couldn't find index page for 'incremental' (maybe misspelled?)
Download error on https://pypi.org/simple/: [Errno 101] Network is unreachable -- Some packages may not be found!
No local packages or working download links found for incremental>=16.10.1
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-rx8lshzz/Twisted/setup.py", line 20, in <module>
    setuptools.setup(**_setup["getSetupArgs"]())
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 128, in setup
    _install_setup_requires(attrs)
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/setuptools/dist.py", line 504, in fetch_build_eggs
    replace_conflicting=True,
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 774, in resolve
    replace_conflicting=replace_conflicting
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1057, in best_match
    return self.obtain(req, installer)
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1069, in obtain
    return installer(requirement)
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/setuptools/dist.py", line 571, in fetch_build_egg
    return cmd.easy_install(req)
  File "/home/newuser/anaconda3/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 667, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1')


    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-rx8lshzz/Twisted/

Tags: installpipinpyhttpscomhomepackages