I can't seem to get MatPlotLib to work. I downloaded and installed the correct version (matplotlib-1.1.0.win32-py2.7.exe), and I already have numpy and scipy installed (and they work with no problems).
This is the error that I get:
C:\python code>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 95, in <module>
new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Python27\lib\site-packages\matplotlib\backends\__init__.py", line 25,
in pylab_setup
globals(),locals(),[backend_name])
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", lin
e 8, in <module>
import Tkinter as Tk, FileDialog
File "C:\Python27\lib\lib-tk\Tkinter.py", line 38, in <module>
import FixTk
File "C:\Python27\lib\lib-tk\FixTk.py", line 65, in <module>
import _tkinter
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>
Any ideas?
This problem occurs when you have a previous 64-bit version of python that was incorrectly uninstalled.
Uninstalling both versions of python correctly, and then reinstalling 32-bit python fixed the problem.
Zach the best way to install matplotlib in windows is to go for Python(x,y) as a Bundle. All the dependencies are solved, and you get a really cool IDE and the full documentation.
See Python(x,y) here,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With