-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix windows build #68
Conversation
@@ -32,7 +32,7 @@ Make sure you replace the paths in the following instructions with your own k4a | |||
It is important to replace `1.2.0` with your installed version of the SDK. | |||
|
|||
``` | |||
pip install pyk4a --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.2.0\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.2.0\sdk\windows-desktop\amd64\release\lib" | |||
pip install pyk4a --no-use-pep517 --global-option=build_ext --global-option="-IC:\Program Files\Azure Kinect SDK v1.4.1\sdk\include" --global-option="-LC:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\lib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like as this option helps: --no-use-pep517
There some glues:
@shagren Would you mind trying to install similarly to how they do it here? warning: I am not sure how to handle spaces in paths on windows.
Then try example/viewer.py to make sure it can be imported. |
It's helps with pip. Module compiled and installed. This solution is better then my. But viewer didn't work:
I have tried to add Next snippet added before 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") |
I think the problem is only from python 3.8, as detailed here: https://docs.python.org/3/whatsnew/3.8.html
So if I understand (didn't test), before python 3.8, we could load a DLL by simply including the directory to the PATH environment variable. At runtime, Your code works, probably for python versions 3.8 and before. 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") In python 3.8, we can now use os.add_dll_directory(r"C:\Program Files\Azure Kinect SDK v1.4.1\sdk\windows-desktop\amd64\release\bin")
What do you think about this? Am I getting something wrong? ¹: we could also force the most recent k4a SDK version and ask people to upgrade their kinect firmware if they want to use pyk4a |
I cannot build module on windows via command from
README.md
: like as--global-option=...
not passed tosetup.py
.But I can install module from source via
python setup.py build_ext -I...
.Option
--no-use-pep517
is easiest workaround. Let's fix README.Maybe after #39 some additional fix will be required to build system.