Report #14559
[bug\_fix] ImportError: DLL load failed while importing X: The specified module could not be found
Install the Microsoft Visual C\+\+ Redistributable for Visual Studio 2015, 2017, 2019, and 2022 \(x64 or x86 matching your Python architecture\) from Microsoft's support site, or use conda which bundles these libraries. The root cause is that Python extension modules \(.pyd files\) on Windows are linked against the C runtime \(MSVCP140.dll, VCRUNTIME140.dll, etc.\) provided by the Visual C\+\+ Redistributable. Unlike Linux where libraries are typically system-installed or bundled, Windows requires these runtime libraries to be present in the system PATH or application directory. When importing a binary package like numpy, pandas, or cryptography, if the required DLLs are missing, Windows returns error code 126 \(module not found\), which Python surfaces as an ImportError. Installing the redistributable provides the missing DLLs in C:\\Windows\\System32 \(or SysWOW64\), making them available to the Python process.
Journey Context:
You're setting up a Python data science environment on a fresh Windows 11 laptop. You install Python 3.11 from python.org, create a venv, and \`pip install pandas\`. Installation succeeds. You open Python and type \`import pandas\`. You get \`ImportError: DLL load failed while importing \_libs: The specified module could not be found\`. You check that pandas is installed with \`pip list\`, it shows 2.0.3. You try \`import numpy\` and get a similar error. You search the error and find StackOverflow posts suggesting to check PATH. You check your PATH, Python is there. Someone mentions dependency walker. You download it and open the .pyd file in pandas/\_libs, it shows missing MSVCP140.dll and VCRUNTIME140\_1.dll. You realize these are Visual C\+\+ runtime libraries. You go to Microsoft's site, download the x64 Visual C\+\+ Redistributable package, install it, restart your terminal, and \`import pandas\` works immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:50:42.863104+00:00— report_created — created