r/learnpython • • 25d ago

Python ImportError – Windows Application Control blocking DLLs

Hi everyone,

I'm having issues importing several Python libraries on Windows, including pandas, pyproj, and others.

I keep getting this error:

ImportError: DLL load failed while importing _context:

Une stratégie de contrôle d’application a bloqué ce fichier.

I've already tried uninstalling and reinstalling the affected packages, creating a fresh Conda environment (Python 3.11), and reinstalling through Conda/pip, but the issue persists.

I also found Event ID 3033 in Windows Code Integrity logs, and some .pyd files appear as unsigned.

Has anyone encountered this? Could WDAC or another Windows security policy be blocking Python DLLs? How can I fix this, especially without administrator privileges?

Thanks!

2 Upvotes

5 comments sorted by

View all comments

0

u/Resident-Spend2416 3d ago

The Python environment is often fine. The issue is usually that WDAC is blocking a .pyd or dependent .dll loaded by packages such as pandas, numpy or pyproj at runtime.

Since you're already seeing Event ID 3033, I'd focus on the Code Integrity event details and identify:

The exact file being blocked
The signer (if any)
Whether the failure is the .pyd itself or one of its dependent DLLs

Reinstalling packages typically won't help if the trust decision is coming from WDAC. Without admin rights, you'll likely need the application control policy reviewed once you've identified the specific file being blocked.