【问题标题】:pip + how to download the latest version of the .whl filespip + 如何下载最新版本的 .whl 文件
【发布时间】:2020-09-12 23:46:27
【问题描述】:

可以下载最新版的.whl文件吗?

例如,首先,我们尝试用 pip 下载一些特定版本的enum34

pip download enum34-1.1.10-py2-none-any.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: Requirement 'enum34-1.1.10-py2-none-any.whl' looks like a filename, but the file does not exist
Processing ./enum34-1.1.10-py2-none-any.whl
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/download.py", line 132, in run
    reqs, check_supported_wheels=True
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 179, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 362, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 314, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 469, in prepare_linked_requirement
    hashes=hashes,
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 264, in unpack_url
    unpack_file(file.path, location, file.content_type)
  File "/usr/lib/python2.7/site-packages/pip/_internal/utils/unpacking.py", line 252, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/usr/lib/python2.7/site-packages/pip/_internal/utils/unpacking.py", line 112, in unzip_file
    zipfp = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: '/var/tmp/enum34-1.1.10-py2-none-any.whl'

那我们尝试下载最新版的enum34*

pip download enum34*
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Invalid requirement: 'enum34*'

【问题讨论】:

  • 您使用哪种操作系统?
  • path/to/pythonX.Y -m pip download enum34
  • rhel 7.5 这是操作系统
  • @jessica 试试这个; yum install python-enum34
  • pip 不尊重通配符。 pip download enum34 下载最新版本。

标签: python python-2.7 pip ansible rhel


【解决方案1】:

尝试pip download enum34,因为没有像enum34* 这样的包,如下图所示。 correct syntax

【讨论】:

  • 是升级,我要的是下载
  • 尝试 pip install enum34
  • pip.pypa.io/en/stable/reference/pip_download 它说 pip 下载的分辨率和下载与 pip install 相同,但它不是安装依赖项,而是将下载的发行版收集到提供的目录中(默认为当前目录)。该目录稍后可以作为值传递给 pip install --find-links 以方便离线或锁定包安装。
  • doc say - pip download SomePackage ,但为什么它在 pip download enum34* 上失败了
  • 你试过在enum34*中不带*,比如pip download enum34
猜你喜欢
  • 1970-01-01
  • 2018-06-27
  • 2020-09-23
  • 2012-11-13
  • 2012-03-29
  • 2014-07-27
  • 2022-11-05
  • 2016-11-22
  • 2018-03-19
相关资源
最近更新 更多