0

I need to install python packages with pip on a machine without internet access. To do that, I tried to download these packages from the following link : https://www.lfd.uci.edu/~gohlke/pythonlibs/ I thought the whl files are complete packages but when I try to install with pip I get the following error

pip install .\pyproj-3.2.1-cp310-cp310-win_amd64.whl

        WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewC
    onnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000000F76ABA6EC0>: Failed to establish a new
     connection: [WinError 10061] No connection could be made because the target machine actively refused it')': 

ERROR: Could not find a version that satisfies the requirement certifi (from pyproj) (from versions: none)
ERROR: No matching distribution found for certifi

The packages I need to install are:

  • Numpy
  • GDAL
  • PYPROJ
  • FIONA
  • SHAPELY
  • GEOPANDAS

I also tried with pip download on my local machine with internet connection but when I try to use the generated whl I get the same issue

How should I proceed to install theses packages?

riuss
  • 1
  • 1
  • 4
  • How, exactly, did you do this? Please show us the commands. – Tim Roberts Nov 12 '21 at 07:08
  • This looks like there were some dependecies. Packages often are built on top of others (e.g. `pandas` needs `numpy` to function). But without knowing either your packages now command/s, we can only make assumptions. – white Nov 12 '21 at 07:13
  • Yes that was also my assumption that it needs other dependencies. I have edited my post with more details – riuss Nov 12 '21 at 07:28
  • https://stackoverflow.com/search?q=%5Bpip%5D+offline – phd Nov 12 '21 at 12:44

2 Answers2

0

like this

pip install --no-index --find-links=<lolcal-folder> <package-name>

e.g.

pip install --no-index --find-link=/tmp/python-wheels exchangelib

More info here

Dean Van Greunen
  • 5,060
  • 2
  • 14
  • 28
0

I finally found a solution. I don't know if it's the best way to do it but it works.

  1. On a machine with internet I installed all the required packages in a virtual environment.
  2. I created a requirement.txt with pip freeze > requirements.txt.
  3. I used pip download -r requirement.txt to download the packages
  4. I copied it onto the other machine.
  5. I created a new requirements.txt with the filenames (ls > requirements.txt).
  6. I installed the packages with pip install -r requirements.txt.
buddemat
  • 4,552
  • 14
  • 29
  • 49
riuss
  • 1
  • 1
  • 4