ImportError: DLL load failed: %1 is not a valid Win32 application for Python Matplotlib

后端 未结 3 2015
迷失自我
迷失自我 2020-12-01 22:10
>>> from matplotlib import pyplot as plt

Traceback (most recent call last):
  File \"\", line 1, in 
    from matplotlib imp         


        
3条回答
  •  粉色の甜心
    2020-12-01 22:26

    Just to add to ThePredator answer:

    I had both 32 bit and 64 bit Python 2.7 installed. When I ran python from cmd, Windows would load 32 bit python, but when trying to run something with matplotlib, this error would pop up. I have a 64 bit machine

    What I did to solve

    1. Uninstall all python versions (check within Control Panel -> Programs and Resources)
    2. Install coherent versions for python ant matplotlib (32 bit python should go with 32 bit matplotlib, etc.). Most recent Python installers come with pip, so make sure Python directory is in your PATH AND just enter pip install matplotlib in a command prompt and you should be fine.

提交回复
热议问题