import matplotlib._png as _png Import: Error: DLL load failed: The specified module could not be found

后端 未结 9 1318
灰色年华
灰色年华 2021-02-07 06:20

I use the Anaconda Python distribution: Python 2.7 x64 with Windows 7 SP1 x64 Ultimate.

When I do import matplotlib.pyplot I get ImportError: DLL load

相关标签:
9条回答
  • 2021-02-07 07:00

    I met the same error prompt. At last I found that I open the jupyter notebook in a different enviroment, not the enviroment that I used before. It means the module is not in your directory of your jupter noetbook enviroment. So I just open jupyter notebook in the original enviroment, the problem solved.

    0 讨论(0)
  • 2021-02-07 07:03

    Try downgrading to a lower version, this command worked for me:

    conda install libpng=1.6.22
    

    This downgrades matplotlib and some other packages too, but seems to play well together.

    0 讨论(0)
  • 2021-02-07 07:04

    Ensure you have closed all python stuff when you run this. Using the following code at the command prompt (not ipython prompt) produces an environment named "working" with Anaconda 2.2.0, Cython 0.22, Numpy 1.9.2 py33_0, Pandas 0.15.2, and Python 3.3.5.

    conda create -n working python=3 anaconda
    

    To then use the environment run

    activate working
    

    Now you can launch ipython or notebook and (at a minimum) matplotlib should import.

    0 讨论(0)
  • 2021-02-07 07:05

    I have had this problem as well. It seems to have cropped up in the last week or two. It seems like something in the scipy stack was compiled incorrectly. In the near term:

    conda install anaconda
    

    will roll your system back to a stable anaconda distribtution.

    0 讨论(0)
  • 2021-02-07 07:06

    I suppose the related issue is here: https://github.com/conda/conda/issues/1753

    I solved the same problem by re-installing Anaconda.

    0 讨论(0)
  • 2021-02-07 07:13

    The SciPy stack which came by default with Anaconda was corrupted in my case.

    conda and pip are two different package managers which you can use to install python packages. conda can install various packages, it installs python itself as a package. pip caters to python users.

    The conda packages were corrupted, so removing that package, which came by default, and installing it again using pip worked for me.

    Try the following:

    1. Create a new environment

    This step is performed only as a safety measure. You can skip this step.

    Open Anaconda prompt and

    conda create --name testtrial python=3  //install whichever version of Python you want 
    activate testtrial
    

    2. Removing and installing new packages

    conda remove matplotlib //required only if you skipped the first step and are working in the default(root) environment 
    pip install matplotlib
    

    That should solve the problem.


    A quick guide on working with conda.

    0 讨论(0)
提交回复
热议问题