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 * This is also broken in EL-5. I'll clone this to there. Version-Release number of selected component (if applicable): python-basemap-0.99.2-6.fc12.x86_64 How reproducible: always Steps to Reproduce: 1. see above 2. 3. Actual results: failed import Expected results: successful import
I just built a version locally with this, and it didn't help. Did you do anything else?
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
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