realitix / vulkan

The ultimate Python binding for Vulkan API
Apache License 2.0
505 stars 46 forks source link

Import vulkan failed on Mac. #91

Open BelconZhao opened 5 months ago

BelconZhao commented 5 months ago

I tried to learn vukan today with my Macbook. I installed SDK (vulkansdk-macos-1.3.283.0.dmg). I also installed vulkan module via pip. You can check my output attached as below. But I got "Cannot find Vulkan sDK version" error when I import vulkan module. The error happened when python tried to load dynamic library. I checked with module cffi and found it worked fine. That means this issue is not related to the path.

Any suggestions? Thanks a lot.

`(.venv) zhaob@C02GC2VUMD6T vulkan % pip list Package Version


cffi 1.16.0 glfw 2.7.0 pip 24.0 pycparser 2.22 vulkan 1.3.275.1 (.venv) zhaob@C02GC2VUMD6T vulkan % python3 -m "import vulkan" /Users/belconzhao/Study/python/Vulkan/vulkan_tutorial/.venv/bin/python3: No module named import vulkan (.venv) zhaob@C02GC2VUMD6T vulkan % python3 -c "import vulkan" Traceback (most recent call last): File "", line 1, in File "/Users/belconzhao/Study/python/Vulkan/vulkan_tutorial/.venv/lib/python3.12/site-packages/vulkan/init.py", line 1, in from vulkan._vulkan import * # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/belconzhao/Study/python/Vulkan/vulkan_tutorial/.venv/lib/python3.12/site-packages/vulkan/_vulkan.py", line 111, in raise OSError('Cannot find Vulkan SDK version. Please ensure that it is ' OSError: Cannot find Vulkan SDK version. Please ensure that it is installed and that the //lib/ folder is in the library path (.venv) zhaob@C02GC2VUMD6T vulkan % python3 - <<EOF
heredoc> import cffi heredoc> ffi = cffi.FFI() heredoc> lib = ffi.dlopen('libvulkan.dylib') heredoc> print(f'{lib}') heredoc> ffi.dlclose(lib) heredoc> EOF <cffi.api._make_ffi_library..FFILibrary object at 0x10d98e960> (.venv) zhaob@C02GC2VUMD6T vulkan % `