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

Loading DLL fails in Python 3.8.5 on windows #60

Closed
matnilswe opened this issue Sep 8, 2020 · 11 comments
Closed

Loading DLL fails in Python 3.8.5 on windows #60

matnilswe opened this issue Sep 8, 2020 · 11 comments

Comments

@matnilswe
Copy link

Python 3.8.5 (with venv)
when importing:
from pyk4a import PyK4A
I hit the issue:
"DLL load failed while importing k4a_module: The specified module could not be found"

DLL loading works when installing and importing from Python 3.7.5

@lpasselin
Copy link
Collaborator

First time I hear this. Not sure how to help you.

Is python 3.7.5 also with venv?

Is it possible that the venv with python 3.8 tries to reuse the 3.7.5 version? Maybe try uninstalling and reinstalling using --upgrade ?

Can you try installing from the develop branch?

@matnilswe
Copy link
Author

The 3.7.5 Python I tried was in a conda environment. To be clear this is what I tried after failing with the Python 3.8.5 with venv. Don't think that the issue has anything to do with "reuse". Hard to see exactly what fails since it's in "k4a_module.cp38-win_amd64.pyd" I guess.

@lpasselin
Copy link
Collaborator

lpasselin commented Sep 9, 2020 via email

@matnilswe
Copy link
Author

pip 20.2.2

@matnilswe
Copy link
Author

FYI. upgraded to pip 20.2.3.
Issue remains.

@lpasselin
Copy link
Collaborator

I'm really not a windows expert.

DLL load failed while importing k4a_module: The specified module could not be found Is this related to the depthengine DLL?

There is a similar issue here #14

@lpasselin lpasselin changed the title Loading DLL fails in Python 3.8.5 Loading DLL fails in Python 3.8.5 on windows Sep 12, 2020
@lpasselin
Copy link
Collaborator

lpasselin commented Sep 12, 2020

@shagren do you know how to fix this? multiple Windows users have the problem.

@shagren
Copy link
Contributor

shagren commented Sep 21, 2020

@matnilswe , please add this code at begining of your py file:

from ctypes import c_wchar_p, windll  
from ctypes.wintypes import DWORD

AddDllDirectory = windll.kernel32.AddDllDirectory
AddDllDirectory.restype = DWORD
AddDllDirectory.argtypes = [c_wchar_p]
AddDllDirectory(r"C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\bin") # modify path there if required

@lpasselin
Copy link
Collaborator

Might be solved in master with #68
Would you mind trying to install with the command in the README?

@matnilswe
Copy link
Author

Used the install command you suggested. pip install pyk4a --no-use-pep517 --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.0\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.0\sdk\windows-desktop\amd64\release\lib"

Import seems to work now. Thanks! :-)

@matnilswe
Copy link
Author

Eh, I must have tried it in my anaconda env. Seems to work on 3.8.2 anaconda, but now I seem to still have the same issue in my venv for 3.8.5. Sorry about the confusion.

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

3 participants