Monday, September 19, 2016

Raspberry Pi & Arch Linux - Day 5 - install numpy and scipy on Arch Linux


Problem 6: How to install numpy and scipy on ArchLinux

Raspberry Pi has a powerful device: GPIO. To play with it, the first thing to do is to install python and RPI.GPOI to arch linux. It turned out to be tricker than I thought to get python and related packages installed.

To install python is straightforward:

pacman -S python

This will download python3. It is good to start moving to python3 because the official support will end in 2020.

It is convenient to have a python package manager on board. So we install pip:

pacman -S pip

At the time of this writing, pacman is unable to install anaconda, which is the package manager I like the most. On ArchLinux Wiki, it says the url/link is outdated.

Once we have pip, it is straightforward to install RPI.GPIO

pip install rpi.gpio

The next step is to install some common-used libraries, such as numpy and scipy. I tried to use pip and easy_install to install them. However it took too much time to complete that I needed to stop the process. It seems that it is not recommended to install numpy ans scipy via pip in Linux machine because the it actually downloads the package and compile it locally. And this may be the reason why when I tried to install numpy using pip I got compiling error (saying that fortran compiler is missing etc...).

The alternative is to use pacman:

pacman -S python-numpy python-scipy

We also install openCV in case we need to do some image processing later when I receive the camera:)

pacman -S opencv

No comments:

Post a Comment