1

How can I install numpy and pandapower on the RASPBIAN JESSIE LITE Minimal image based on Debian Jessie? the one without the GUI. And how can I install Pip and miniconda on it as well?

2

By default, Jessie Lite for Raspberry Pi have python 2.7 installed but does not have pip/setuptools/wheel installed. To install pip, run:

sudo apt-get install python-pip

This will install setup tools and wheel along with pip.

You can then use pip to install packages you will need. To install NumPy:

pip install --user numpy

or

sudo pip install numpy

I recommend using the --user flag to pip (without using sudo pip). This will install packages for your local user, and does not need extra permissions to write to the system directories.

1

I recommend installing numpy via apt-get not via pip as the latter needs to compile the lib on the Pi and that is no fun. Not sure about pandas but I would expect something similar. So use:

sudo apt-get install <program name or abbreviation>

With program name being something like 'python-numpy'.

Pip on the other hand should already be installed if Python is available.


Update:

The MagPi, Issue 64 reports about piwheels:

Pi Foundation Community Manager Ben Nuttall has released piwheels, a set of pre-compiled Python modules that reduces the install time from tens of minutes to a couple of seconds. Pip is the best way to install Python packages, as it grabs the very latest version. However, often these packages “have been implemented in C and require compilation,” Ben explains. Compilation takes ages, however – installing the NumPy package on a Pi 3 can take over 20 minutes.

The Python community solved this problem a while back with ‘wheels’, pre-compiled versions of packages for common hardware and software combinations. However, until Ben’s project, there were no wheels for a Pi running Raspbian. Enter Ben with his epic project to pre-compile all 750,000 wheels for the Raspberry Pi. With some help from SQL expert Dave Jones (@waveform80), and the Raspberry Pi Foundation’s web host Mythic Beasts (mythic-beasts.com), there are now over 670,000 wheels for more than 96,000 packages. NumPy now installs in seconds using the command sudo pip3 install numpy.

So now one could use pip to install numpy and pandas without long compilation times simply by:

sudo pip3 install numpy
  • I tried sudo apt-get install numpy and it gave me this message Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package numpy Same for Pandapower as well. BTW this is the Raspbian without the GUI. – Mohammad Aug 13 '17 at 18:48
  • @Mohammad Try 'python-numpy' instead. Numpy and pandas should not require gui so that should not be an issue. – Ghanima Aug 13 '17 at 19:20
  • Thanks for your advice. I tried upgrading numpy using pip this time instead of apt-get (on a Raspberry Pi Zero) and I'm sure it's been going for about an hour. $ sudo pip install --upgrade numpy ... Building wheels for collected packages: numpy Running setup.py bdist_wheel for numpy ... -. Am I doing something wrong? – Bill Nov 12 '18 at 0:04
  • Well, that was a waste of time. After about an hour it said: Successfully built numpy Installing collected packages: numpy Found existing installation: numpy 1.8.2 Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. Should I have uninstalled all my existing packages first? Any advice welcome. – Bill Nov 12 '18 at 0:27
  • @bill mixing different installing schemes is indeed not a good idea. You should either stick to one or - if need be to switch - uninstall first. – Ghanima Nov 12 '18 at 8:07

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.