Need help installing 3.71 on Win7 + matplotlib

I have a Python app I wrote on Linux and I’m trying to port to Windows. It works perfectly on Linux

I’ve tried half a dozen or so different suggestions to get this to work, to no avail. It keeps failing at the ‘import matplotlib.pyplot as plt’ line. Here’s the info dump. Whatever I did wrong, I promise I will never, ever do it again, Ok? Thanks in advance.

Traceback (most recent call last):
  File "PythonApp.py", line 72, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\__init__.py
", line 107, in <module>
    from . import _api, cbook, docstring, rcsetup
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\rcsetup.py"
, line 26, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\colors.py",
 line 82, in <module>
    from matplotlib import _api, cbook, scale
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\scale.py",
line 18, in <module>
    from matplotlib.ticker import (
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\ticker.py",
 line 179, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\DevGuy\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\transforms.
py", line 46, in <module>
    from matplotlib._path import (
ImportError: DLL load failed: The specified module could not be found.

C:\Users\DevGuy\Desktop\PythonApp>py -m pip "freeze"
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.4.2
numpy==1.20.3
Pillow==8.2.0
pyparsing==2.4.7
python-dateutil==2.8.1
six==1.16.0

C:\Users\DevGuy\Desktop\PythonApp>py --version
Python 3.7.1

Howdy Jaf,

your line

import matplotlib.pyplot as plt

works perfectly well in my setup:

My environment had been setup using the Blythooon-Netinstaller (Windows 10):

blythooon · PyPI

Python Runtime Environment for Scientific Applications with Qt based GUI - Blythooon, Part 1 - YouTube

Cheers, Dominik

1 Like

Thanks Dominik! Using that as a breadcrumb I was able to trace that the problem was I needed to install VC++ redistributable (for 2015) from MS in order for matplotlib to work right!

Seems to work fine now!

1 Like