4

I live in the sticks and don't have a direct internet connection on my Pi. I need to download the Python libraries and move them locally offline.

How can I download them from somewhere I do have an Internet connection and transfer them to my Pi to install them?

4 Answers 4

3

You can install packages using pip from source archives.

  1. Go to pip website
  2. Search for the package you want and download its tar.gz file
  3. Install with pip


pip install /path/to/file.tar.gz

I suggest you initially install virtualenv (you better learn how to use it anyway).

sudo apt-get install python-virtualenv

The reason I suggest that is that you might find it useful to install things to a virtualenv and not damage you system from dependency problems which are likely to rise from offline installations.

2
  • Not disagreeing, but I don't see how dependency problems can arise from offline isntallations if apt-get is used...maybe I just haven't run into them before but all offline installations I've done have worked fine after I reconnected them to the intarwebz.
    – Lawrence
    Commented Jul 31, 2013 at 1:28
  • 1
    Not sure I understood. My answer does not say he should use apt-get. I was suggesting pip, which is the python package manager. I guess its not directly connected to the question, but from experience things tend to go wrong when you do stuff offline, and if they do virtualenv means you didn't break your system, and have no internet to help you recover.
    – GuySoft
    Commented Jul 31, 2013 at 15:40
1

The easiest way is to do what lenik said and move the Pi to an internet connection.
However, there is a fairly easy way to do it. But it may require a few trips.

You will need to find all the packages that you need. Debian has a package finder @ http://packages.debian.org/search?keywords=python&searchon=names&suite=stable&section=all

Once you know which ones you need, you will need to download them from http://mirrordirector.raspbian.org/raspbian/pool/

Then once you have retreived the ones you need, place them into /var/cache/apt/archives/ and run apt-get install python which should then install the packages that you have just placed into the archives directory. If you have missed any, it should tell you.

0

In short -- you cannot. Please, bring your Pi to the internet connection you have and download everything directly, moving files manually is a reliable way to mess up your OS installation.

0

You might want to look at the Keryx remote package manager. Unfortunately their website is down, but here are some articles:

This will help you keep all packages updated on the Pi, not just Python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.