Axes3d vs axes3d matplotlib

12,566

The following two things work for me (watch your capitalization):

from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import axes3d

But I get the same error for what you wrote (with the d in 3d in lower case). Note that the two imports that do work are not equivalent.

Share:
12,566
The Wind-Up Bird
Author by

The Wind-Up Bird

Updated on July 19, 2022

Comments

  • The Wind-Up Bird
    The Wind-Up Bird almost 2 years

    I just finished a horrible install of scipy, numpy, and matplotlib on OSX Lion. For some reason, I can't do a:

    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3d
    

    Error output is:

    Traceback (most recent call last):
      File "3dPlot.py", line 2, in <module>
        from mpl_toolkits.mplot3d import Axes3d
    ImportError: cannot import name Axes3d
    

    but I can do:

    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import axes3d
    

    Is there a different between Axes3d and axes3d, or is my file just named with a lowercase 'a' for some reason?

  • Tom
    Tom almost 8 years