I did not have any problem to use "plt", but it suddenly shows an error message and does not work, when I import it. Please see the below.
>>> import matplotlib
>>> import matplotlib.pyplot as plt
Output:
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 6, in <module>from matplotlib.figure import Figure, figaspectFile "/usr/lib64/python2.6/site-packages/matplotlib/figure.py", line 18, in <module>from axes import Axes, SubplotBase, subplot_class_factoryFile "/usr/lib64/python2.6/site-packages/matplotlib/axes.py", line 2, in <module>import math, sys, warnings, datetime, newFile "new.py", line 12, in <module>import matplotlib.pyplot as pltAttributeError: 'module' object has no attribute 'pyplot'
This package is suddenly corrupted. So, I tried to install as below. I use Ubuntu.
In [1]: sudo apt-get install python-matplotlibFile "<ipython-input-1-2400ac877ebd>", line 1sudo apt-get install python-matplotlib^
SyntaxError: invalid syntax
If I need to reinstall, what are the detailed instructions on how to do it?
I am very new to Python. So, my problem might be too simple to be solved. But I cannot.