No module named 'ipympl' found (original) (raw)
Thanks so much for a detailed response. I tried a different browser w/o success. I used %pip list which doesn’t show ipympl as an installed module. In contrast to my other computer where I everything works, ipympl was listed using %pip list. I read a little about it and it may be an environment variable issue.
Here is my code and what happens when I run the code
import ipympl
%matplotlib widget
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
creating random dataset
xs = [14, 24, 43, 47, 54, 66, 74, 89, 12, 44, 1, 2, 3, 4, 5, 9, 8, 7, 6, 5]
ys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 6, 3, 5, 2, 4, 1, 8, 7, 0, 5]
zs = [9, 6, 3, 5, 2, 4, 1, 8, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
creating figure
fig = plt.figure()
ax = Axes3D(fig,auto_add_to_figure=False)
fig.add_axes(ax)
creating the plot
plot_3D = ax.scatter(xs, ys, zs, color=‘green’)
setting title and labels
ax.set_title(“3D plot”)
ax.set_xlabel(‘x-axis’)
ax.set_ylabel(‘y-axis’)
ax.set_zlabel(‘z-axis’)
displaying the plot
plt.show()
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ipympl
2 get_ipython().run_line_magic(‘matplotlib’, ‘widget’)
3 from mpl_toolkits.mplot3d import Axes3D
ModuleNotFoundError: No module named ‘ipympl’