

Debian packages are usually pretty stable, so if you can make your code work with it, you won't have to worry about maintaining your own upgrades. Live with it: are you sure you really have to have the latest version? If your code requires functions or bugfixes from the latest version, then this isn't an option. Sometimes it ships with really ancient versions, like its Netpbm distribution, which is over 12 years out of date. (you can drop the -user flag if you want to install it system-wide, but you'll need root privilege).įinally, one remove the extra swap and restore the default: sudo swapoff /var/swap.1ĭebian, as goldilocks pointed out, doesn't always ship with the latest versions of packages.

Then one can finally build and install with python3 setup.py build The problem is that in the Raspberry Pi the swap space is particularly small (only 100MB I think), while the norm would be to have it the same size of your RAM.Īs explained here and here, swap space can be increased typing the following: sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 This is due to the compiling script occupying the totality of both RAM and swap memory by spawning multiple processes (and replicating memory by consequence). C and Fortran compilers, gcc and gfortran įinally you need the source code, that you can download from here (Scipy 1.0.0 is the latest stable version as I am writing).Īt this point, if you start the build process, it will seem to go fine, but it will hang after a few minutes.A BLAS/LAPACK math library with development headers, e.g.You should try and use the version of these packages that comes with Raspbian (in packages such as python3-numpy), but they might need to be built separately (OT).Īs far as system requirements go, you'll need a few packages that can be installed with apt-get, namely: As far as python packages go, you'll need numpy, cython, setuptools, and (if you want to build the documentation) Sphinx. There are a few requirements for building scipy. I'll just try and summarize the whole process (so that people don't have to jump around the internet like I did).
#Alpine install gfortran trial#
If this was all you needed it would be relatively easy (main instructions can be found here and are summarized below), but there is an additional problem with the raspberry pi that I realized only after a week of research and trial and error (skip at the end if you just need the fix), which is due, I believe, to the small amount of memory available. Usually pip install would fetch prebuilt packages for you, but Raspberry Pi's ARM architecture is not really supported. The main reason is that scipy relies on compiled C and fortran libraries, that need to be compiled on the same architecture. To get the latest version of scipy on the raspberry Pi you need to build from source.
#Alpine install gfortran how to#
TL DR: skip to the last paragraph to know how to increase swap space and avoid memory clogging.
