添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import mpl_toolkits on Python3 . Will need other parts of mpl_toolkits soon.

python3 version is 3.5.1
matplotlib version is 1.5.1

import mpl_tookits
#Error
 #No module named 'mpl_tookits'

Luckily, I only need basemap right now

#Basemap Bug Fix
import importlib
mpl_toolkits = importlib.import_module('mpl_toolkits')
from mpl_toolkits.basemap import Basemap
          

This appears to be an oddity of your particular installation, not a general characteristic or a bug. You could raise this on the matplotlib-users mailing list (after subscribing, if you have not already done so), including information about what your operating environment is and how you installed matplotlib.

Hi elfring, thanks for responding.

It seems to be a problem for others as well:
pyinstaller/pyinstaller#848
#3252
http://matplotlib.1069221.n5.nabble.com/ImportError-No-module-named-mpl-toolkits-td43642.html
http://stackoverflow.com/questions/16769899/matplotlib-basemap-no-module-named-axes-grid1
https://borealperspectives.wordpress.com/2013/11/24/91/
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/KnbWZ5pl0pE

A potentially similar problem has cropped up before, as you note, but it is not a current matplotlib bug. As explained in some of the reports you cite, there was an awkward transition period in the handling of namespace packages, when some mixtures of versions or sequences of installation could cause the problem. Without more information it is impossible to even speculate on what is causing the present failure on your system--but I'm confident that it is a peculiarity of your installation, hence my recommendation that you raise your question (and add essential information) on the mailing list, where more people will see it and there will be a better chance of someone coming up with a solution.

Can't import mpl_toolkits on Python3. Will need other parts of mpl_toolkits soon.

python3 version is 3.5.1 matplotlib version is 1.5.1

import mpl_tookits
#Error
 #No module named 'mpl_tookits'

Luckily, I only need basemap right now

#Basemap Bug Fix
import importlib
mpl_toolkits = importlib.import_module('mpl_toolkits')
from mpl_toolkits.basemap import Basemap

i faced Error:cannot import name 'Axes3d' from 'mpl_toolkits.mplot3d'
so i immitated your code
import importlib
mpl_toolkits = importlib.import_module('mpl_toolkits')
from mpl_toolkits.mplot3d import Axes3D
so i immitated your code
import importlib
mpl_toolkits = importlib.import_module('mpl_toolkits')
from mpl_toolkits.mplot3d import Axes3D
it works