Error to install packages in python Computer without a network ( Errno 11001)

Question:

strong textI manually install package as follows:
pip install C:UsersAAA PCDesktopselenium.whl

I get the following error:

Collecting requests
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0424C6F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E150>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E230>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E310>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0426E3F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/requests/
  Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
Asked By: Liel00

||

Answers:

How about instead of using Pip, use setup.py. If you download the selenium tarball you can run python setup.py install from within the uncompressed directory of the tar file.

Answered By: awesomemaker3000

First make sure pip is up to date using this command:

python -m pip install --upgrade pip

Then run to install the wheel file, run this command:

pip install "C:/Users/AAA PC/Desktop/selenium.whl"

However, this is not the original name of the wheel file. The official wheel name, from PyPi is:

selenium-3.141.0-py2.py3-none-any.whl

So you should delete that file and reinstall it from PyPi. You’ll end up with this command:

pip install "C:/Users/AAA PC/Desktop/selenium-3.141.0-py2.py3-none-any.whl"
Answered By: DapperDuck
pip install "C:UsersAAA PCDesktopselenium.whl"

This should install from any directory.

An important thing worthy of noting is the .whl file name should not be renamed from the original. For example, if you want to install .whl for the selenium module, I believe the original name of the file is "selenium-3.141.0-py2.py3-none-any.whl" (as per PyPI)

Hence you need to rename the file to the original name and install using

pip install "C:UsersAAA PCDesktopselenium-3.141.0-py2.py3-none-any.whl"

else you could see errors like "ERROR: selenium.whl is not a valid wheel filename"

Also, your error says, collecting requests.
This tells the python is having issues downloading the requests module, not with the selenium module. Hence you could first install requests.whl and then try installing selenium

Answered By: Sahil_Angra

First upgrade:

python -m pip install --upgrade pip

Then, enter in the terminal:

pip install -U selenium
Answered By: Team Weak
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.