orbbec / pyorbbecsdk

OrbbecSDK python binding
https://orbbec.github.io/pyorbbecsdk/
Apache License 2.0
88 stars 23 forks source link

ModuleNotFoundError: No module named 'pyorbbecsdk'` #57

Open JakkapongW opened 3 months ago

JakkapongW commented 3 months ago

I followed the steps in the Orbbec SDK Python Wrapper Documentation, but I am still getting the error ModuleNotFoundError: No module named 'pyorbbecsdk' after trying to run a file from the Examples.

Note: I am using VS Code with Python 3.10.4.

tushardmaske commented 3 months ago

cd into pyorbbecsdk and paste commands below in the terminal

export PYTHONPATH=$PYTHONPATH:$(pwd)/install/lib/ sudo bash ./scripts/install_udev_rules.sh sudo udevadm control --reload-rules && sudo udevadm trigger

OR

you can put these commands in .sh file (for ex setup.sh) and every-time just do "source setup.sh"

JakkapongW commented 3 months ago

@tushardmaske Thank you for you reply Is this code for Linux? Do you have one for Windows?

5d6d0011 commented 3 months ago

Me too. On Windows, I have tried various methods, but still got ModuleNotFoundError: No module named 'pyorbbecsdk'

JunJie-zhang-o commented 3 months ago

import sys sys.path.append("your pyorbbecsdk.so path")

you can try this on the header of the py file

Withey958 commented 2 months ago

yes this is giving us issues also.

On windows using various different methods to try and get round this.

Withey958 commented 2 months ago

I got this working eventually but documentation could probably do with updating.

zhonghong322 commented 2 months ago

@JakkapongW @5d6d0011 which sample? if you use save_pointcloud_to_disk.py or save_pointcloud_to_disk_by_filter.py , need install plyfile.

When installing plyfile with pip install plyfile, do not use a VPN, as it may cause installation issues.

wjstarrsiii commented 1 month ago

Hello. I am also unable to get this working with Windows. I have followed all instructions, compiled the DLLs and pyd files and placed them in examples folder, but I still get ModuleNotFound.

I have done the same on Archlinux and after updating PYTHONPATH to include the sdk install\lib directory I do not have this issue.

Is there any update on why this is not working on Windows?

Thanks

wjstarrsiii commented 1 month ago

I have solved this in my Windows installation. I found that the pyd file was being compiled for a different version of python than what I had in my virtual environment. I deleted the entire pyorbbecsdk directory and cloned it fresh. I then followed the instructions. I used CMake-GUI, but I launched it from the command line within the venv after installing the requirements. "C:\ProgramFiles\CMake\bin\cmake-gui.exe". After configuring, generating, then building and installing with Visual Studio and copying the files over, the pyd correctly was built to cp311 and the examples all are running.