First time here? Check out the FAQ!
1

Loading pyd files with Python 3.8

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.

jkpeck's avatar
11
jkpeck
asked 2020-08-02 15:05:34 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2020-08-24 08:58:33 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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.

Wingware Support's avatar
4.2k
Wingware Support
answered 2020-08-03 09:10:05 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer