0

Python 3.4 Windows 8.1

Installed modules:
matplotlib 1.3.1 for py 3.4
numpy-MLK 1.9.0b1 for py 3.4
dateutil 2.2 for py 3.4
six 1.7.3 for py 3.4
tcl
tkinter
Also msvcp71.dll is in C:\Windows\System32 (installation docs said it needed to be)

Upon running:

import matplotlib.pyplot as plt

I get the following error message:

Traceback (most recent call last): File "<pyshell#284>", line 1, in <module> import matplotlib.pyplot as plt File "D:\Downloaded Programs\Python\lib\site-packages\matplotlib\pyplot.py", line 98, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "D:\Downloaded Programs\Python\lib\site-packages\matplotlib\backends\__init__.py", line 28, in pylab_setup globals(),locals(),[backend_name],0) File "D:\Downloaded Programs\Python\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 11, in <module> import matplotlib.backends.tkagg as tkagg File "D:\Downloaded Programs\Python\lib\site-packages\matplotlib\backends\tkagg.py", line 2, in <module> from matplotlib.backends import _tkagg ImportError: DLL load failed: The specified module could not be found.

Point being: Python\lib\site-packages\matplotlib\backends\tkagg.py is trying to
execute

from matplotlib.backends import _tkagg

but failing to do so. However _tkagg.pyd file does exist in the directory
Python\lib\site-packages\matplotlib\backends

Why is this not working then?

  • your installation or path is borked. Try removing and reinstalling. Also make sure that if you did not compile the c-extensions your self they are build for 3.4 – tacaswell Jul 03 '14 at 17:48
  • I tried reinstalling - didn't really change things. Apparently the problem is that the `_tkagg.pyd` file refers to `tk86t.dll` and `tcl86t.dll` neither of which it can find. Any ideas as to what I should do – Shariar Rahman Jul 07 '14 at 03:20

1 Answers1

0

I know this is an old thread, but I just ran into the same problem and I found a solution, so I decided to answer it.

By taking a look at matplotlib install documentation, it says:

For Python 3.5 the Visual C++ Redistributable for Visual Studio 2015 needs to be installed.

I installed it's 64 bit version from it's Microsoft website (as I use 64 bit Python 3.6.3, and now the import works fine.

I hope it helps anyone that may face the same issue in the future.

Marco Gomez
  • 359
  • 2
  • 6