-1

I'm going on vacation into a foreign country and I want to take my Pi 2 with me to play a bit, not having a particular project in mind. I may not have Internet access all the time or it may be limited to a few 100 MB or has a limited band-width.

While I might be able to google for answers, I don't want to download and install large amounts of data.

Is there a way I can install all python modules, so whatever code example I'll find I have at least the module already installed on my Pi?

I can install single modules with e.g.

sudo pip install abjad

and I'm looking for

sudo pip install *

as well as getting a rough idea how much disk space this would need. At the moment I have a 16 GB SD card, but I could switch to a 64 GB disk.

1

The following worked on Raspbian Jessie, which was the most recent release at the time of writing.

Due to some PIP issues, fix that first

sudo apt-get remove python-pip
sudo easy_install3 -U pip

For some of the following installations, I also needed to install their dependencies:

# for lxml
sudo apt-get install libxml2-dev libxslt1-dev
# for abjad
sudo apt-get install lilypond
# For pygtk
sudo apt-get install python-gtk2
# for pyfirmata
sudo apt-get install python-serial
sudo apt-get install arduino
sudo apt-get install python-scipy

It seems there are many interesting modules that I'll need during my trip. Some of them were already installed

# already installed
sudo pip install -U rpi.gpio
sudo pip install -U simplejson
# already installed
sudo pip install -U requests
sudo pip install -U lxml
sudo pip install -U nose
sudo pip install -U colorama
sudo pip install -U selenium
sudo pip install -U numpy
sudo pip install -U abjad
sudo pip install -U matplotlib
sudo pip install -U formlayout

And for some Arduino-Shield experiments:

sudo pip install -U pyfirmata
-1

Unfortunately, you cannot install all the Python modules with a single command. The py packages are roughly millions. Depending on your project you can install your desired packages.

I recommend you install some basic and important packages for almost any project.

  1. numpy

sudo pip install numpy

  1. scipy

sudo pip install scipy

  1. matplotlib

sudo pip install matplotlib

  1. pandas

sudo pip install pandas

  1. sklearn

sudo pip install sklearn

  1. opencv (for image processing)

I prefer compiling and building it instead of installing the defaults

  1. RPI.GPIO

sudo pip install rpi.gpio

Those you will always use in any project you want.

The 16 GB SD card is excellent for a Pi. I think 64 GB will make your Pi become slower. Remember the Pi is a mini-PC not a real desktop. The speed will always be a headache.

Last thing to mention, always use a 2A 5V Adapter as the peripherals are current hungry. Sometimes if the peripherals don't get enough current, the Pi shuts down as a short-circuit protection.

Hope I helped.

  • 1
    Technically I can't follow how a 64 GB SD card will make the Raspberry slow. I'm also missing a package for GPIO in your list – Thomas Weller Jul 24 '16 at 18:58
  • GPIO package is usually installed with sudo apt-get update or sudo apt-get install python-dev – Tes3awy Jul 24 '16 at 18:59
  • @ThomasWeller If you put your Raspbian img on a 8 or 16GB SD card, you will notice a little bit increase in speed rather than on 64GB one. – Tes3awy Jul 24 '16 at 19:03
  • @ThomasWeller if my answer is convenient, please consider accepting it. – Tes3awy Jul 25 '16 at 20:52
  • @OsamaAbbas: -1 for the second to last paragraph. The size of the SD card won't impact the RPi's performance at all. – Jacobm001 Jul 28 '16 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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