Thanks to visit codestin.com
Credit goes to github.com

Skip to content

basemap does not install correctly with matplotlib 1.4.x #115

Closed
@jswhit

Description

@jswhit

Eric Firing reported on mpl-developer:

"If I do a clean install of mpl master, and then of basemap, basemap lands in dist-packages/mpl_toolkits, as it always has. But now it is not found--I can't import it. It seems that now the real mpl_toolkits is cleverly hidden inside an egg directory with a monstrous name, leaving basemap orphaned in a directory with no init.py. As a workaround I can symlink it into the egg location. "

I can see three potential solutions for this problem:

  1. just add an empty init__py to basemap in lib/mpl_toolkits. Advantage: easy, and allows user code with "from mpl_toolkits.basemap import Basemap" to still work. Disadvantage: packaging systems will have to deal with the potential of colliding mpl_toolkits/__init.py files (one owned by matplotlib and one owned by basemap).

  2. somehow figure out how to install inside a matplotlib egg, or to make a symlink to the mpl_toolkits/init.py inside the matplotlib egg. This is probably impossible.

  3. Give up on the "mpl_tookits" install path, and just install as "basemap". Advantages: easy, prevents further breakage when matplotlib changes the mpl_toolkits hierarchy. Disadvantage: Breaks user code. Users will have to change

from mpl_toolkits.basemap import Basemap

to

from basemap import Basemap.

Right now I favor solution (1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions