5

Due to network constraints and certificates error I am not able to install python libraries using pip normally.

So I tried downloading .whl and install the library manually. However it also failed with the same error.

C:\python3.7>python -m pip install requests-2.21.0-py2.py3-none-any.whl
Processing c:\python3.7\requests-2.21.0-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests==2.21.0)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x039C3D90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567350>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567D10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04567FD0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04545F70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/idna/
  Could not find a version that satisfies the requirement idna<2.9,>=2.5 (from requests==2.21.0) (from versions: )
No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0)

Tried --use-wheel option as suggested but doesn't work. Looks like pip is old, however I can't even upgrade pip because that also needs a proper working net. It's a catch22 situation.

C:\python3.7>python -m pip install --use-wheel requests-2.21.0-py2.py3-none-any.whl

Usage:
  C:\python3.7\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
  C:\python3.7\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
  C:\python3.7\python.exe -m pip install [options] [-e] <vcs project url> ...
  C:\python3.7\python.exe -m pip install [options] [-e] <local project path> ...
  C:\python3.7\python.exe -m pip install [options] <archive url/path> ...

no such option: --use-wheel

How can I manually install libraries?

2 Answers 2

4

On the machine with working pip, issue:

$ mkdir wheelhouse
$ pip download --dest wheelhouse requests

This will download requests and all its dependencies to the wheelhouse directory. Now move the directory to the target machine, there issue

$ pip install requests --no-index --find-links wheelhouse/

This will tell pip to not to search for packages online and instead look for them in the wheelhouse directory ("offline" install).

Sign up to request clarification or add additional context in comments.

4 Comments

ok, can I get like all or most of packages in a single go in wheelhouse? otherwise again and again I would have to download, move, install
pip download will download the package and all its dependencies in one go, as long as you don't tell it to do the opposite with --no-deps. Also, check out my comment in your other question with a command suggestion.
as in like all the collection of packages even if GB in size
No, only every package required to install requests; four or five of them.
3

The issue is not your wheel, that works. But this line is important:

No matching distribution found for idna<2.9,>=2.5 (from requests==2.21.0)

So you would need to download idna as well. Probably other dependencies as well.

$ python -m pip show requests
Requires: urllib3, chardet, idna, certifi

So you'll need those four as well. To be honest, I think you'll have a lot of difficulty trying to accomplish this all manually. The dependency tree might be several levels deep.

8 Comments

Oh :( that is cumbersome, is there a way I can have all the wheels downloaded required for that package.
and python -m pip shows requests shows blank output
Yes, I noticed that as well. The show only works if the module is installed. Have you tried this approach here? To avoid certificate problems: stackoverflow.com/a/29751768/1291498
yes, see my other question. stackoverflow.com/questions/54406115/… I became so frustrated over that, my company IT is shit. I don't think I would be able to explain them the particular issue and I need to develop this POC ASAP
Auch :( I feel your frustration. Afraid there's no other way then manually trying to find out what the dependencies are and download those. Starting from the lowest dependency. The good news is, from what I can see; for requests you only need those four I mentioned. They have no further dependencies! But I'm guessing requests is not the only requirement you have ..
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.