0

we are trying to install the following wheel file

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

one option is:

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'

the second option is:

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'

on both option pip failed to find the .whl file

what is interesting is that pip ignore the folder /tmp/test

what is going here ? , why pip cant installed the wheel file and find it under /tmp/test folder?

reference:

enter image description here

jessica
  • 2,426
  • 24
  • 66
  • Does this answer your question? [Wheel file installation](https://stackoverflow.com/questions/28002897/wheel-file-installation) – Bram Vanroy Jun 24 '20 at 09:16
  • 2
    Either **1.** you pass the full path to a _wheel_ file or **2.** you give `--no-index`, `--find-links` with the path to the directory containing the _wheel_, and the name of the project contained in the wheel (not the file name of the wheel). – sinoroc Jun 24 '20 at 09:33
  • just little question - can we use the option pip install --no-index --find-links=file:///tmp/test argparse --force-reinstall OR pip install --no-index --find-links=file:///tmp/test argparse --ignore-installed – jessica Jun 24 '20 at 09:41
  • Not entirely sure, so you should try for yourself. My assumption would be that if (case **1.**) you provide the full path to the wheel file explicitly, then it will be installed no matter what is already installed. But if (case **2.**) you provide the project name (`SomePackage`, or `argparse` with the index and links options), then you might have to provide the options `--ignore-installed` and/or `--force-reinstall` as well. – sinoroc Jun 24 '20 at 09:59

1 Answers1

2

It is likely that you need to use the package name rather than the wheel's file name. Try

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

However, installing the wheel directly should work:

pip install /tmp/test/argparse-1.4.0-py2.py3-none-any.whl
Bram Vanroy
  • 27,032
  • 24
  • 137
  • 239
  • why we cant to use this - pip install --no-index --find-links=file:///tmp/test argparse-1.4.0-py2.py3-none-any.whl ? with full path of the file? – jessica Jun 24 '20 at 09:17
  • 1
    Because you are using --find_links which does something very specific. Try the second option that I gave. – Bram Vanroy Jun 24 '20 at 09:17
  • how to check if - wheel library installed: ? – jessica Jun 24 '20 at 09:18
  • 1
    Please use Google for such questions. https://askubuntu.com/questions/588390/how-do-i-check-whether-a-module-is-installed-in-python-and-install-it-if-needed – Bram Vanroy Jun 24 '20 at 09:19
  • can we use the option pip install --no-index --find-links=file:///tmp/test argparse --force-reinstall OR pip install --no-index --find-links=file:///tmp/test argparse --ignore-installed – jessica Jun 24 '20 at 09:23
  • about the option- pip install /tmp/test/argparse-1.4.0-py2.py3-none-any.whl , no so good because I want to work off line on local folder - we not have network internet , – jessica Jun 24 '20 at 09:26