How to install "basemap" for Python?

Matplotlib is in repositories but “basemap” isn’t.

Google says that for Ubuntu there’s “sudo apt-get install python-mpltoolkits.basemap” but I can’t find any similar named packages for openSUSE.

There are instructions on how to install basemap from source but it requires installing matplotlib from source as well, which I don’t want to do.

When trying to install with setup.py in basemap package from the developer it asked for Geos, which I then installed from repos but now it complains

compilation terminated.
src/_geoslib.c:254:31: fatal error: numpy/arrayobject.h: No such file or directory
 #include "numpy/arrayobject.h"

Numpy, however, is installed from the repos and otherwise works.

Hi
Is this the python2 or python3 version?

If you look down in /usr/include and search for arrayobject.h assuming pythonN-numpy-devel package is installed, it should be there?

Ah, needed python-numpy-devel and also geos-devel. Didn’t think of those two, thank you.

Now it compiled fine.

In case someone needs this - download source .tar, extract it, then in terminal navigate to that directory and run

“sudo python setup.py install”

I got some “cannot find Geos” error at first and followed the suggestion to edit appropriate line in setup.py manually. Install needs relevant python-xxx-devel packages, too, whatever it complains about. Once it works this extracted directory can be deleted.

It’s been years since this kind of things had to be done manually in terminal. Good times…