Description
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:
-
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).
-
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.
-
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).