+++ This bug was initially created as a clone of Bug #559086 +++ Description of problem: $ python Python 2.6.2 (r262:71600, Jan 8 2010, 22:06:26) [GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.toolkits.basemap Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named toolkits.basemap This is because there is no __init__.py file in site-packages/matplotlib/toolkits/ to import basemap. This one line in __init__.py makes it work again: from basemap import * Version-Release number of selected component (if applicable): python-basemap-0.9.5-1.el5 How reproducible: always Steps to Reproduce: 1. see above 2. 3. Actual results: failed import Expected results: successful import
Two things, Firstly wrong package, you wanted python-matplotlib rather than python-basemap the hint was in your import line "import matplotlib.toolkits" (not "import basemap") Secondly, this is not a bug, this is an API change. See : http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg07053.html > NOW basemaps won't work any more! When I run, I get: > > Traceback (most recent call last): > File "C:\Documents and > Settings\kpeters\smworkspace\parsesmExcelFile\src\readParse\ExcelClass.py", > line 13, in <module> > from matplotlib.toolkits.basemap import Basemap as Basemap > ImportError: No module named toolkits.basemap One of the api changes is that the import line for basemap (and all matplotlib toolkits) is import mpl_toolkits.basemap rather than import matplotlib.toolkits.basemap
Moving the conversation from the Fedora ticket (https://bugzilla.redhat.com/show_bug.cgi?id=559086) over to the EPEL ticket " Thanks for looking at the bug again. I wound up doing this in mirrormanager: # ABI breakage try: # this export sucks - basemap should do this automatically os.environ['BASEMAPDATA'] = '/usr/share/basemap' from mpl_toolkits.basemap import Basemap except: # python-basemap-0.9.5 from matplotlib.toolkits.basemap import Basemap " EPEL API breakage is kinda sucky. Part of me thinks that we should put a very basic matplotlib.toolkits.basemap package in that simply pretends to be mpl_toolkits.basemap just to avoid the API breakage. But there's only been the one ticket, the update happened 9 months ago, and there also seemed to be a strong demand for the version increment... https://bugzilla.redhat.com/show_bug.cgi?id=502082