2012-06-04 23 views
5

Parece que no puedo hacer que MatPlotLib funcione. Descargué e instalé la versión correcta (matplotlib-1.1.0.win32-py2.7.exe), y ya tengo instalado numpy y scipy (y funcionan sin problemas).Instalación de MatPlotLib en Windows

Este es el error que me sale:

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. 
>>> 

¿Alguna idea?

+0

'python -c" import Tkinter "' no funciona. Dice 'ImportError: la carga DLL falló:% 1 no es una aplicación Win32 válida. Pero ambos dlls están en' Python27 \ DLL'' ... – Zach

Respuesta

7

Este problema se produce cuando se tiene una anterior versión de 64 bits de Python que se ha desinstalado de forma incorrecta.

Desinstalar ambas versiones de python correctamente y luego reinstalar Python de 32 bits corrigió el problema.

3

Zach la mejor manera de instalar matplotlib en Windows es ir a Python (x, y) como un paquete. Todas las dependencias están resueltas, y obtienes un IDE realmente genial y la documentación completa.

Ver Python(x,y) here,

+0

+1 para contrarrestar el negativo y las sugerencias. Sin embargo, me gustaría tener mi propia instalación para trabajar. – Zach

+0

@Zach, debe marcar la respuesta a su pregunta, o simplemente edite su Pregunta para incluir su solución. Pero dale una oportunidad a PythonX, Y viene con un increíble IDE. – Oz123

0

La instalación de versiones de 32 bits de todas las librerías necesarias resolverá el problema.

Cuestiones relacionadas