Disclaimer: I'm new to python and first post, so I apologize if this isn't formatted correctly or somewhere on the site. I haven't found anything thus far though.
I'm using Python 2.7 (32 bit) on Win7 (64 bit) and trying to use matplotlib to generate simple plots. I have numpy, scipy, and installed matplotlib. matplotlib is installed as 32bit.
I have a script ('different.py') that has only one line:
import matplotlib.pyplot as plt
running this script in the command prompt returns the following error:
C:\Users\Robert\Desktop>python different.py
Traceback (most recent call last):
File "different.py", line 1, in <module>
import matplotlib as plt
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 165, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 20, in <module>
from matplotlib.colors import is_color_like
File "C:\Python27\lib\site-packages\matplotlib\colors.py", line 54, in <module>
import matplotlib.cbook as cbook
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 34, in <module>
import new
File "C:\Users\Robert\Desktop\new.py", line 1, in <module>
import matplotlib.pyplot
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 23, in <module>
from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name interactive
However, when i open the python (command line) program, and enter
import matplotlib.pyplot as plt
plt
it runs and returns < module 'matplotlib.pyplot' from 'C:\Python27\lib\sitepackages\matplotlib\pyplot.pyc'>
so as far as I can tell it imports the library from the shell, but it's having an issue in the command prompt, and I have no idea why. The only post I've seen related said it was having trouble importing the name interactive because the user had titled their script as "new". I had that originally, but saved the script as 'different.py' thinking it would fix the issue, which it didn't.
Any idea as to why the ImportError is occuring in the command prompt but not the shell?