Search code examples
pythonpip

pip install. Installing modules locally


Im trying to install modules (i.g. mypy) from directories on my PC using

pip install "path like C:\user\mypy.whl or .gz"

, but it always shows the error

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000024AFFAB2B30>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/tomli/

I really don't understand why does it connect to pypi.org if Im trying to install it from local dir


Solution

  • I actually was in your situation when I didn't have internet access and had to ship modules in wheel files. The problem is likely with dependencies here: while installing mypy.whl, it says that it requires dependencies (simply speaking, another modules in imports) such as tomli and others. So you now have to install tomli first, then all other dependencies, and remember that the dependencies can have their own dependencies. Welcome to dependency hell.

    You can start with downloading tomli, transferring it to your machine and installing it. If after that you'll see some other module in the error message, you'll have to satisfy that dependency, and so on, and so forth.