-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
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
How to get the mpl_toolkits to install #4546
Comments
I can not reproduce this issue:
works as expected (where I suspect that you at some point install mpl using more than one method and there are stale files left around. I suggest starting from a fresh environment (and never working in the 'base' environment). To try and revive your current env I suggest telling conda to uninstall mpl and basemap, then going into the site-packages folder, then remove Please ping to have this re-opened if you can reproduce this with a clean environment |
I uninstalled matplotlib and basemap using conda and manually deleted Any suggestions? P.S. - are you running on a Mac platform or on a linux platform? Please On 06/21/2015 13:55:00, Thomas A Caswell wrote:
|
Did you try with a clean environment? Have you installed python or matplotlib using any other method? Do you have PYTHONPATH defined? Where does your python think it is importing mpl_toolkits from? I suggest you try either the matplotlib-users mailing list or report this as a bug against anaconda. |
I'm trying it on a Mac right now, but with 10.9.5. I will report in a few minutes. |
I had to add |
Eric, Thanks for responding so quickly. If I'm picking up some detritus from Any suggestions? Sam Dupree On 06/21/2015 14:37:40, Eric Firing wrote:
|
I think the fundamental issue here and in other similar issue is that the directory structure depends on the installation method. setup.py install will place everything in xxx/site-packages/matplotlib-versionxxx.egg/matplotlib and xxx/site-packages/matplotlib-versionxxx.egg/mpl_toolkits etc. while pip omits the matplotlib-versionxxx.egg directory and places installations in site-packages/matplotlib and site_packages/mpl_toolkits/ I guess you still have some left over incomplete installation that gets picked up You can check that mpl and mpl|_toolkits are were you expect by doing something like import matplotlib
print matplotlib.__file__ Use this to check that matplotlib is imported from where you expect. and provided that you can import mplot3d you can also do.
|
The problem is most likely due to an old install of Basemap, since it is On Sun, Jun 21, 2015 at 3:24 PM, Jens Hedegaard Nielsen <
|
this might be happening due to a conflict between nxviz versions of matplotlib and brew installed versions. i was using nxviz and then installed some other libraries on same env using brew and then this occured. would be good if nxviz had a brew repo. |
I'm attempting to run a Matplotlib example that requires the use of mpl_toolkit mplot3d. I'm running Anaconda on a MackBook Pro running Mac OS X 10.10.3. I have the latest version of Anaconda and Matplotlib installed. I also installed Basemap which as I understand it also installs mpl_toolkits at the same time.
The sample program is attached to this posting. I get the following error message when I run it:
Traceback (most recent call last): File "/Users/user/coursera - programming for everybody (python)/Week - 06/3d-line.py", line 2, in from mpl_toolkits.mplot3d.axes3d import Axes3D ImportError: No module named mpl_toolkits.mplot3d.axes3d
Any suggestions?
Sam Dupree.
import matplotlib as mpl
from mpl_toolkits.mplot3d.axes3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.gca(projection='3d')
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z = np.linspace(-2, 2, 100)
r = z**2 + 1
x = r * np.sin(theta)
y = r * np.cos(theta)
ax.plot(x, y, z, label='parametric curve')
ax.legend()
plt.show()
The text was updated successfully, but these errors were encountered: