pip install + pip 无法从本地平面目录安装 wheel 文件

pip install + pip cant instelled the weel file from a local flat directory

我们正在尝试安装以下 wheel 文件

  ls /tmp/test
    argparse-1.4.0-py2.py3-none-any.whl

一个选项是:

pip install --no-index --find-links=file:///tmp/test argparse-1.4.0-py2.py3-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 'argparse-1.4.0-py2.py3-none-any.whl' looks like a filename, but the file does not exist
Looking in links: file:///tmp/test
Processing ./argparse-1.4.0-py2.py3-none-any.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/argparse-1.4.0-py2.py3-none-any.whl'

第二个选项是:

pip install --no-index --find-links=/tmp/test argparse-1.4.0-py2.py3-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 'argparse-1.4.0-py2.py3-none-any.whl' looks like a filename, but the file does not exist
Looking in links: /tmp/test
Processing ./argparse-1.4.0-py2.py3-none-any.whl
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/tmp/argparse-1.4.0-py2.py3-none-any.whl'

两个选项 pip 都找不到 .whl 文件

有趣的是 pip 会忽略文件夹 /tmp/test

这是怎么回事? ,为什么 pip 无法安装 wheel 文件并在 /tmp/test 文件夹下找到它?

参考:

您可能需要使用包 name 而不是 wheel 的文件名。尝试

pip install --no-index --find-links=file:///tmp/test/ argparse

然而,:

pip install /tmp/test/argparse-1.4.0-py2.py3-none-any.whl