pip 无法从 .whl 安装 Twisted 作为依赖项

时间:2021-04-27 13:12:56

标签: pip twisted

我正在尝试安装 Channels 以便将其与 Django 一起使用,并且我想使用 docker(基于 linux)中的 .whl 文件进行此安装。我使用 pip wheel channels 获得了我的 .whl 文件,但是当我尝试安装它们时,它会尝试寻找 Twisted,即使它已经安装。

注意:如果我从我的轮文件中取出 Twisted-myversion.whl,pip 能够正确安装它并且一切正常。该错误仅在 pip 尝试使用 Twisted.whl 文件时发生。我 100% 认为我使用的 whl 文件版本是正确的,因为它与我在不使用 whl 的情况下安装软件包时获得的 pip freeze 输出一致。

警告:我要发布很多信息,我不知道这是否是在 StackOverflow 上提问的正确方式,但我认为向您提供我所拥有的所有信息是一个很好的开始。< /strong>

我尝试使用verbose进行安装,以下是我认为可能有趣的信息:

Processing ./bin/wheels/Twisted-21.2.0-py3-none-any.whl
  Added Twisted==21.2.0 from file:///code/bin/wheels/Twisted-21.2.0-py3-none-any.whl to build tracker '/tmp/pip-req-tracker-58_mg5hs'
  Removed Twisted==21.2.0 from file:///code/bin/wheels/Twisted-21.2.0-py3-none-any.whl from build tracker '/tmp/pip-req-tracker-58_mg5hs'

-> 这意味着 Twisted 已按预期安装。

* https://pypi.org/simple/twisted/
Fetching project page and analyzing links: https://pypi.org/simple/twisted/
Getting page https://pypi.org/simple/twisted/
Found index url https://pypi.org/simple
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/twisted/ HTTP/1.1" 200 21069
  Found link https://files.pythonhosted.org/packages/7d/11/6f06a
...

-> 出于某种原因,它试图再次找到它。

Collecting twisted[tls]>=18.7
  Created temporary directory: /tmp/pip-unpack-j8fl903c
  Starting new HTTPS connection (1): files.pythonhosted.org:443
  https://files.pythonhosted.org:443 "GET /packages/f2/16/3eb9c66a7bfb5220c7bcbaaac33d359fe8a157b028959cd210983749b2e0/Twisted-21.2.0-py3-none-any.whl HTTP/1.1" 200 3084565
  Downloading Twisted-21.2.0-py3-none-any.whl (3.1 MB)
  Added twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/f2/16/3eb9c66a7bfb5220c7bcbaaac33d359fe8a157b028959cd210983749b2e0/Twisted-21.2.0-py3-none-any.whl#sha256=aab38085ea6cda5b378b519a0ec99986874921ee8881318626b0a3414bb2631e (from daphne==3.0.2) to buil
  Removed twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/f2/16/3eb9c66a7bfb5220c7bcbaaac33d359fe8a157b028959cd210983749b2e0/Twisted-21.2.0-py3-none-any.whl#sha256=aab38085ea6cda5b378b519a0ec99986874921ee8881318626b0a3414bb2631e (from daphne==3.0.2) from
  Created temporary directory: /tmp/pip-unpack-t2efwxil
  https://files.pythonhosted.org:443 "GET /packages/b7/04/1a664c9e5ec0224a1c1a154ddecaa4dc7b8967521bba225efcc41a03d5f3/Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl HTTP/1.1" 200 3077171
  Downloading Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl (3.1 MB)
  Added twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/b7/04/1a664c9e5ec0224a1c1a154ddecaa4dc7b8967521bba225efcc41a03d5f3/Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaedec3f1e689292 (from daphne
  Removed twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/b7/04/1a664c9e5ec0224a1c1a154ddecaa4dc7b8967521bba225efcc41a03d5f3/Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaedec3f1e689292 (from daph
  Created temporary directory: /tmp/pip-unpack-wncjd3ev
  https://files.pythonhosted.org:443 "GET /packages/88/e2/0c21fadf0dff02d145db02f24a6ed2c24993e7242d138babbca41de2f5a2/Twisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl HTTP/1.1" 200 3069612
  Downloading Twisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl (3.1 MB)
  Added twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/88/e2/0c21fadf0dff02d145db02f24a6ed2c24993e7242d138babbca41de2f5a2/Twisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=f28355e61ce0b5c1ce47784522022322cc5059c8ed80638e0caae8c7301e1705 (from daphn
  Removed twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/88/e2/0c21fadf0dff02d145db02f24a6ed2c24993e7242d138babbca41de2f5a2/Twisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=f28355e61ce0b5c1ce47784522022322cc5059c8ed80638e0caae8c7301e1705 (from dap
  Created temporary directory: /tmp/pip-unpack-eihs83mq
  https://files.pythonhosted.org:443 "GET /packages/14/49/eb654da38b15285d1f594933eefff36ce03106356197dba28ee8f5721a79/Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl HTTP/1.1" 200 3060990
  Downloading Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl (3.1 MB)
  Added twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/14/49/eb654da38b15285d1f594933eefff36ce03106356197dba28ee8f5721a79/Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=998e3baf509c7cf7973b8174c1050ac10f6a8bc1aaf0178ad6a7c422c75a0c68 (from daphne
  Removed twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/14/49/eb654da38b15285d1f594933eefff36ce03106356197dba28ee8f5721a79/Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=998e3baf509c7cf7973b8174c1050ac10f6a8bc1aaf0178ad6a7c422c75a0c68 (from daph
  Created temporary directory: /tmp/pip-unpack-034fs9m1
  https://files.pythonhosted.org:443 "GET /packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2 HTTP/1.1" 200 3097651
  Downloading Twisted-19.2.1.tar.bz2 (3.1 MB)
  Added twisted[tls]>=18.7 from https://files.pythonhosted.org/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from daphne==3.0.2) to build tracker
    Running setup.py (path:/tmp/pip-install-4cthyx74/twisted_c743fdc34424412886e6e58c0b68a63c/setup.py) egg_info for package twisted
    Created temporary directory: /tmp/pip-pip-egg-info-7h07sjm4
    Running command python setup.py egg_info
    running egg_info
    creating /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info
    writing /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/dependency_links.txt
    writing entry points to /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/entry_points.txt
    writing requirements to /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/requires.txt
    writing top-level names to /tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/SOURCES.txt'
    adding license file 'LICENSE' (matched pattern 'LICEN[CS]E*')
    reading manifest file '/tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*.misc' found under directory 'src/twisted'
    warning: no previously-included files matching '*.bugfix' found under directory 'src/twisted'
    warning: no previously-included files matching '*.doc' found under directory 'src/twisted'
    warning: no previously-included files matching '*.feature' found under directory 'src/twisted'
    warning: no previously-included files matching '*.removal' found under directory 'src/twisted'
    warning: no previously-included files matching 'NEWS' found under directory 'src/twisted'
    warning: no previously-included files matching 'README' found under directory 'src/twisted'
    warning: no previously-included files matching 'newsfragments' found under directory 'src/twisted'
    warning: no previously-included files found matching 'src/twisted/topfiles/CREDITS'
    warning: no previously-included files found matching 'src/twisted/topfiles/ChangeLog.Old'
    warning: no previously-included files found matching 'pyproject.toml'
    warning: no previously-included files found matching 'codecov.yml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching '.circleci'
    warning: no previously-included files matching '*' found under directory '.circleci'
    no previously-included directories found matching 'bin'
    no previously-included directories found matching 'admin'
    no previously-included directories found matching '.travis'
    no previously-included directories found matching '.github'
    warning: no previously-included files found matching 'docs/historic/2003'
    warning: no previously-included files matching '*' found under directory 'docs/historic/2003'
    writing manifest file '/tmp/pip-pip-egg-info-7h07sjm4/Twisted.egg-info/SOURCES.txt'

-> 它没有在它找到的数百个链接中找到它正在寻找的哈希。所以它尝试下载 Twisted(参见 Downloading Twisted-21.2.0-py3-none-any.whl (3.1 MB) 部分 - 是的,它下载了我从 pip wheel 获得的文件 -)但它实际上下载了它可以找到的每个版本(21.2.0、20.3.0、 19.1.0...)。然后它尝试运行“setup.py”,但对于它能够找到的每个 Twisted 版本都失败了。

INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of zope-interface to determine which version is compatible with other requirements. This could take a while.
...

-> 然后继续查看我使用的每个包,并确定它是否可以使用其他要求。我不知道为什么。

The conflict is caused by:
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 21.2.0 depends on twisted 21.2.0 (from https://files.pythonhosted.org/packages/f2/16/3eb9c66a7bfb5220c7bcbaaac33d359fe8a157b028959cd210983749b2e0/Twisted-21.2.0-py3-none-any.whl#sha256=aab38085ea6cda5b378b519a0ec99986874921ee8881318626b0a3414bb2631e (fro
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 20.3.0 depends on twisted 20.3.0 (from https://files.pythonhosted.org/packages/b7/04/1a664c9e5ec0224a1c1a154ddecaa4dc7b8967521bba225efcc41a03d5f3/Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaede
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 19.10.0 depends on twisted 19.10.0 (from https://files.pythonhosted.org/packages/88/e2/0c21fadf0dff02d145db02f24a6ed2c24993e7242d138babbca41de2f5a2/Twisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=f28355e61ce0b5c1ce47784522022322cc5059c8ed80638e0c
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 19.7.0 depends on twisted 19.7.0 (from https://files.pythonhosted.org/packages/14/49/eb654da38b15285d1f594933eefff36ce03106356197dba28ee8f5721a79/Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=998e3baf509c7cf7973b8174c1050ac10f6a8bc1aaf0178ad6a7c
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 19.2.1 depends on twisted 19.2.1 (from https://files.pythonhosted.org/packages/79/59/035de19362320e632301ed7bbde23e4c8cd6fc5e2f1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from https:/
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 19.2.0 depends on twisted 19.2.0 (from https://files.pythonhosted.org/packages/f8/2b/a80a70f71eb2b86992ffa5aaae41457791ae67faa70927fd16b76127c2b7/Twisted-19.2.0.tar.bz2#sha256=1708e1928ae84ec9d3ebab0d427e20e1e38ff721b15bbced476d047d4a43abbe (from https:/
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 18.9.0 depends on twisted 18.9.0 (from https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2#sha256=294be2c6bf84ae776df2fc98e7af7d6537e1c5e60a46d33c3ce2a197677da395 (from https:/
    The user requested twisted 21.2.0 (from /code/bin/wheels/Twisted-21.2.0-py3-none-any.whl)
    twisted[tls] 18.7.0 depends on twisted 18.7.0 (from https://files.pythonhosted.org/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22/Twisted-18.7.0.tar.bz2#sha256=95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4 (from https:/

To fix this you could try to: 1. loosen the range of package versions you've specified 2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 122, in resolve
    requirements, max_rounds=try_to_avoid_resolution_too_deep,
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 357, in resolve
    raise ResolutionImpossible(causes)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=ExplicitRequirement(LinkCandidate('file:///code/bin/wheels/Twisted-21.2.0-py3-none-any.whl')), parent=None), RequirementInformation(requirement=ExplicitRequirement(LinkCandidate('h)')), parent=ExtrasCandidate(base=LinkCandidate('https://files.pythonhosted.org/packages/f2/16/3eb9c66a7bfb5220c7bcbaaac33d359fe8a157b028959cd210983749b2e0/Twisted-21.2.0-py3-none-any.whl#sha256=aab38085ea6cda5b378b519a0ec99986874921ee8881318626b0a3414bb2631e (from httpsRequirement(LinkCandidate('https://files.pythonhosted.org/packages/b7/04/1a664c9e5ec0224a1c1a154ddecaa4dc7b8967521bba225efcc41a03d5f3/Twisted-20.3.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaedec3f1e689292 (from https://pypux1_x86_64.whl#sha256=2182000d6ffc05d269e6c03bfcec8b57e20259ca1086180edaedec3f1e689292 (from https://pypi.org/simple/twisted/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*)'), extras=frozenset({'tls'}))), RequirementInformation(requirement=ExplicitRequiwisted-19.10.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=f28355e61ce0b5c1ce47784522022322cc5059c8ed80638e0caae8c7301e1705 (from https://pypi.org/simple/twisted/)')), parent=ExtrasCandidate(base=LinkCandidate('https://files.pythonhosted.org/packages/88/e2/0c21fadf0dff02d145licitRequirement(LinkCandidate('file:///code/bin/wheels/Twisted-21.2.0-py3-none-any.whl')), parent=None), RequirementInformation(requirement=ExplicitRequirement(LinkCandidate('https://files.pythonhosted.org/packages/14/49/eb654da38b15285d1f594933eefff36ce03106356197dba28b15285d1f594933eefff36ce03106356197dba28ee8f5721a79/Twisted-19.7.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=998e3baf509c7cf7973b8174c1050ac10f6a8bc1aaf0178ad6a7c422c75a0c68 (from https://pypi.org/simple/twisted/)'), extras=frozenset({'tls'}))), RequirementInformation(requf1cf8d354cdba857854/Twisted-19.2.1.tar.bz2#sha256=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52 (from https://pypi.org/simple/twisted/)')), parent=ExtrasCandidate(base=LinkCandidate('https://files.pythonhosted.org/packages/79/59/035de19362320e632301ed7'file:///code/bin/wheels/Twisted-21.2.0-py3-none-any.whl')), parent=None), RequirementInformation(requirement=ExplicitRequirement(LinkCandidate('https://files.pythonhosted.org/packages/f8/2b/a80a70f71eb2b86992ffa5aaae41457791ae67faa70927fd16b76127c2b7/Twisted-19.2.0.tar.ted-19.2.0.tar.bz2#sha256=1708e1928ae84ec9d3ebab0d427e20e1e38ff721b15bbced476d047d4a43abbe (from https://pypi.org/simple/twisted/)'), extras=frozenset({'tls'}))), RequirementInformation(requirement=ExplicitRequirement(LinkCandidate('file:///code/bin/wheels/Twisted-21.2.0537e1c5e60a46d33c3ce2a197677da395 (from https://pypi.org/simple/twisted/)')), parent=ExtrasCandidate(base=LinkCandidate('https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2#sha256=294be2c6bf84aementInformation(requirement=ExplicitRequirement(LinkCandidate('https://files.pythonhosted.org/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22/Twisted-18.7.0.tar.bz2#sha256=95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4 (from166b267e4 (from https://pypi.org/simple/twisted/)'), extras=frozenset({'tls'})))]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 317, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 127, in resolve
    six.raise_from(error, e)
  File "<string>", line 3, in raise_from
pip._internal.exceptions.DistributionNotFound: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

-> 它终于给了我错误。

我真的不知道我在这里做错了什么。

0 个答案:

没有答案