Results 1 to 3 of 3

Thread: How to install "basemap" for Python?

  1. #1
    Join Date
    Mar 2009
    Location
    Bangkok
    Posts
    431

    Question 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
    Code:
    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.

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,489
    Blog Entries
    15

    Default Re: How to install "basemap" for Python?

    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?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Mar 2009
    Location
    Bangkok
    Posts
    431

    Default Re: How to install "basemap" for Python?

    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..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •