I am having problems importing the base module mpl_toolkits in python. This is what I get when I run test.py script from the module directory:
/usr/lib/python2.7/dist-packages/mpl_toolkits/basemap$ python test.py Traceback (most recent call last): File "test.py", line 1, in <module> from mpl_toolkits.basemap import Basemap, shiftgrid ImportError: No module named basemap
I can not get it, since sys.path gives a list of paths in which I am sure that the baseemap directory is in the mpl_toolkits directory. There import mpl_toolkits no problems for import mpl_toolkits . Here is what I tried to manually add the path and result:
>>> import sys >>> sys.path.append('/usr/lib/python2.7/dist-packages/mpl_toolkits/basemap') >>> import basemap Traceback (most recent call last): File "<stdin>", line 1, in <module> File "basemap/__init__.py", line 30, in <module> from mpl_toolkits.basemap import pyproj ImportError: No module named basemap
I tried to remove the basemap reinstallation from the source (carefully following these instructions), from apt-get, from conda, but this doesnโt change anything: I canโt import the basemap.
thanks for the help
source share