Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLUTION FOR WIN 10 ImportError: DLL load failed #2039

Closed
spacewalkingninja opened this issue Apr 3, 2023 · 1 comment
Closed

SOLUTION FOR WIN 10 ImportError: DLL load failed #2039

spacewalkingninja opened this issue Apr 3, 2023 · 1 comment

Comments

@spacewalkingninja
Copy link

Hey guys,
I noticed this is quite common on win 10 so here's something of a hunch, a lot of y'all and myself too got pythons installed in the C:\Program Files\WindowsApps folder.
THe solution is IOBit unlocker so that u can copy the dreaded files from

C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\pywin32_system32

to

C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0

or whatever ur python is, which can be done by:

python3 -c "import os, sys; print(os.path.dirname(sys.executable))"

where python3 can be [python, py, could be whatever the python command in ur PATH]

Then, once u got dis done now proceed 2:

The only way I know of that works natively within Windows, is to use IObit Unlocker.

After it's installed, just right click on the file you wish to move and select the IObit Unlocker shell extension.

At the next screen, press the drop arrow next to 'Unlock' and select 'Unlock & Move' (or copy), browse to and select destination, and you're done.

https://answers.microsoft.com/en-us/windows/forum/all/windowsapps-folder-permissions/c1d41339-8cdf-4e38-98f2-63bd1c72c619

LETS END THIS MICROSOFT BAD DOMINATION OF THE CONTROL OF OUR PCS!
ALSO MAKE SURE U ASK GITHUB TO LKET US NOT USE 2FA! I HATE 2FA!

@Avasam
Copy link
Collaborator

Avasam commented Mar 17, 2024

This is not a pywin32 issue, nor a Microsoft or GitHub support forum.

Although yes Microsoft is annoying with their default override of the python3 command, and their Store install has issues. So here's a bit of help I can give you and future readers: python/typeshed#8798 (comment)

Sure. Btw just FYI, you don't have to install it from the store (which I've had very bad experience with as well). You can disable that store alias by going under settings > App execution aliases, and disabling it. Then symlink python3 --> python, create a new alias, or copy+rename the python executable. But yeah, annoying just to get a consistent experience across OSes. image.


Since 71afa71, the PATH is now prepended, rather than appended. For Python >= 3.8, the PATH environment variable isn't even used. This is included in pywin32==226.

Python 3.7 has also reached EOL (meaning no security fixes/support) and I'd recommend migrating over to 3.8+ (see #2207)

.exe installers are now deprecated #1939, so you should install from PyPI (ie: pip install pywin32>=226)

Given the sheer amount of "ImportError: DLL load failed: The specified module could not be found." issue duplication and old history, I'd like to consolidate the current state of these issues. So I'll close and reference back any issue that only has comments showing the issue:

  • from before November 10th, 2019 (pywin32<226)
  • using .exe installers
  • using Python < 3.8

Please also try https://github.com/mhammond/pywin32#troubleshooting before opening a new issue.

@Avasam Avasam closed this as completed Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants