Ask Your Question

Loading pyd files with Python 3.8

asked 2020-08-02 15:05:34 -0500

jkpeck's avatar

updated 2020-08-24 08:58:33 -0500

I need to use Mark Hammond's win32 tools with Python 3.8 on Windows 10. This worked with older Python versions, but trying to import win32process and other such modules fails with the unhelpful

builtins.ImportError: DLL load failed while importing win32process: The specified module could not be found.

These are pyd files.

I added the relevant directory using os.add_dll_directory and, for good measure, added these to sys.path, but that did not help.

Now, if I do

import win32process

in the Wing Python 3.8 shell, the import succeeds, but if I do this import in my code, even after os.add_dll_directory, it fails, so I am wondering how Wing makes this work so that I can add that technique to my code that needs to import this location.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-03 09:10:05 -0500

Wing isn't doing anything special for wing32process so the issue is probably due to your environment or (maybe) the current directory. I'd double check that the same python interpreter is being used and look at the value of the PATH environment variable.

The .pyd file should be in a sys.path directory and the .dll files it depends on should be in a directory in the PATH environment variable or a directory added with os.add_dll_directory.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-08-02 15:05:34 -0500

Seen: 3,242 times

Last updated: Aug 02 '20