I am trying to run the same code on my new PC (Windows 11). I installed Python 2.7 and matplotlib in both 64 bit but I still get "ImportError: DLL load failed: %1 is not a valid Win32 application."
I know this has been asked many times (e.g., here, here, here, here, here, here) and after reading all of these previously-asked posts, it seems you get this error when Python and the module bit do not match (e.g., Python in 32 bit and module in 64 bit, and vice versa). That is why I made sure that both are running in 64 bit. I restarted my PC, and I even installed pywin32 in 64 bit but that did not fix this issue.
My environment and versions Windows 11 Pro 64 bit Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. matplotlib: 2.2.5 pywin32: 228
Codes when the error occurs in PowerShell import csv, os, os.path, pdb import matplotlib.pyplot as plt
I also get the same error when I try to import _tkinter (based on another question)
I have been trying to figure this out for days now and I would appreciate it if anybody could suggest what else I could do to make it work. Thanks!