1

I successfully installed most of the python data science packages on my RPi Zero using Geoff Boing's excellent guide. However, the versions of some of the packages seem quite old. E.g. numpy.__version__ is '1.8.2' and scipy is '0.14.0'.

My system:

Raspbian GNU/Linux 8 (jessie)

If I do sudo apt-get upgrade python-numpy

I get python-numpy is already the newest version.

But the most recent version from Scipy is 1.15.

Is it a limitation of my OS or is 1.8.2 the most recent build for RPi or am I doing something wrong?

(My main issue is numpy 1.8.2 doesn't have various methods I want to use like np.flip).

  • 1
    As your OS is also "quite old" i.e. obsolete and unsupported this seems pointless! – Milliways Nov 12 '18 at 1:02
  • 1
    in other words - update to stretch - however, even in stretch I think the "latest" version of python-numpty is 1.12.1 ... and looking further, in buster and sid it's 1.14.5 - so you'll need to look for some other way to get 1.15 – Jaromanda X Nov 12 '18 at 1:26
  • Ah, so I need to update my OS. Thanks for pointing this out. Numpy 1.12.1 would be fine as the flip method was introduced in 1.12.0. – Bill Nov 12 '18 at 2:06
  • As nobody mentioned it; one way to update to the latest release of a package is to build from source. The Numpy User Guide has a chapter on that matter... – jogco Nov 12 '18 at 11:08
  • In case anyone is interested, the advice above was good. I installed Stretch and re-installed everything from scratch using apt-get and a few with pip3. I also made the jump to python 3.5.3. Now I have Numpy version 1.12.1, Scipy 0.18.1 and Pandas 0.19.2. Thanks. – Bill Nov 26 '18 at 6:46
2

You can use the Python package manager Pip to get packages. These are not tied to a distributions packages. You may have to install it via sudo apt-get install python-pip.

To get numpy (1.15.4 at time of writing) you'll need the python dev packages sudo apt-get install python-dev python3-dev. You can omit python3-dev if you are stuck on python2.

Then you can fetch down numpy from pip either globally sudo pip install numpy or if you are using a python virtual environment (virtualenv) then just pip install numpy with the environment activated.

Bear in mind it takes a while to build numpy in this fashion. On a Pi 2 it took about 30 minutes so might take an hour or more on the zero.

  • Odd that so many people want to build this kind of packages from source (especially on models like the Zero). On Raspbian Stretch and Python 3 there are pre-compiled wheels available using pip3. And with a minimal bit of work you can also do the same on Jessie. – Dirk Nov 12 '18 at 20:13
  • Upgrading the entire OS for one package seems like a worse use of time than having pip build this for you. If you feel you can detail the minimal work needed it sounds like problem solved. – tobyd Nov 12 '18 at 20:29
  • Add /etc/pip.conf (see piwheels.org). And it's a good idea to leave Jessie behind soon anyway. Updates will end soon... And IIRC it takes a lot more than an hour to build numpy on a Zero. – Dirk Nov 12 '18 at 21:04
  • I'd make that an answer, looks like it's a neat solution. Nice work. – tobyd Nov 12 '18 at 21:12
  • I think I already did that for other questions. Not sure though. I'll have a look – Dirk Nov 12 '18 at 21:16

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.