0

I am trying to download some packages like pandas, numpy and matplotlib locally on my Mac OS 10 and I need to install them on a Linux machine that has no access to the Internet.

When I use the following command

pip3 install --download="path/to/folder/to/store/packages" pandas matplotlib numpy

     cycler-0.10.0-py2.py3-none-any.whl
-rw-r--r--  1 ***  12755710 May 18 13:00 matplotlib-2.0.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
-rw-r--r--  1 ***   4443374 May 18 13:00 numpy-1.12.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
-rw-r--r--  1 ***  14805391 May 18 13:00 pandas-0.20.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
-rw-r--r--  1 ***     56385 May 18 13:00 pyparsing-2.2.0-py2.py3-none-any.whl
-rw-r--r--  1 ***    194391 May 18 13:00 python_dateutil-2.6.0-py2.py3-none-any.whl
-rw-r--r--  1 ***    484917 May 18 13:00 pytz-2017.2-py2.py3-none-any.whl
-rw-r--r--  1 ***     10341 May 18 13:00 six-1.10.0-py2.py3-none-any.whl

It downloads mac os variants of the package. Will I be able to use the below command to install the packages downloaded above on a Linux machine ?

Or is there a way to ask pip3 to download all possible OS variants of the package ?

pip3 install --no-index --find-links=file:/path/to/folder/with/packages pandas matplotlib numpy
Nikil OK
  • 23
  • 4
  • You might find the easiest thing to do is to just run a virtualized (perhaps with docker) linux on your mac and pull the packages like that. – pvg May 19 '17 at 03:42
  • Yes that's what I was thinking too, but I was wondering if there is a way to ask pip3 to download linux variants of the package ? – Nikil OK May 19 '17 at 03:45
  • I'm not sure it's worth the hassle even if there is a way which seems a little unlikely. You can get a docker your-linux-flavour image up in a few minutes. Fire up a virtual env and load up your packages then move the venv over. – pvg May 19 '17 at 03:51
  • I believe that might be the way to go around it then. Thanks for the help. – Nikil OK May 19 '17 at 03:54
  • The only drawback with this approach of using Docker or VM's to download OS specific version of the package, being I'll have to keep building docker images for every possible environment I need to install these packages for. – Nikil OK May 19 '17 at 03:59
  • What are 'every possible environment'? You said one linux box that has no net access. Your other alternative is to get your linux box on the net somehow, assuming it's not in a lead-lined bunker. – pvg May 19 '17 at 04:02
  • There's also this: http://stackoverflow.com/questions/37391824/simply-use-python-anaconda-without-internet-connection a simpler variant of which may be just grabbing a big giant anaconda distribution. – pvg May 19 '17 at 04:04
  • Just exploring possibilities that may exist beyond the docker / vm solution. It's just one Linux machine for now. – Nikil OK May 19 '17 at 04:05
  • I think if you were looking at pure python packages, this is relatively straightforward but rapidly becomes more unpleasant with things like pandas and numpy. Prepared, standalone blobs of like 'conda seem like a good bet here since they cover what you want. That or (semi-seriously) pair the linux box with your phone. – pvg May 19 '17 at 04:21

0 Answers0