isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.48k stars 2.31k forks source link

Create Executable with Open3d and pyinstaller #6136

Open Alex-Dee opened 1 year ago

Alex-Dee commented 1 year ago

Checklist

My Question

Hi,

I am trying to create a stand-alone application with open3d and pyinstaller. However it seems that pyinstaller has trouble finding the necessary C++ .so files for open3d. Specifically the error message I get is:

WARNING: Cannot find libc++.so.1

I tried to manually add the open3d directory in site packages to ${LD_LIBRARY_PATH} as suggested by the pyinstaller documentation but to no effect. All other libraries I use work out of the box. I am on Ubuntu 22.04 and using poetry to manage my virtual environments. Is there something I am missing and has anybody else tried using open3d with pyinstaller?

Best regards

Timezyxdev commented 1 year ago

I have tried this and was running into issues that appeared to be related to pyinstaller failing to find open3d.visualization.gui and open3d.visualization.rendering. As you said it seems to be because these are C++ and not python. I am trying to use some other tools now to create an executable for my application. Will let you know if I have any further success.

ssheorey commented 1 year ago

Hi @Alex-Dee @Timezyxdev can you list the steps that you performed to create a standalone app with pyinstaller? A simple reproducible example is really helpful for debugging.

JuanIgnacioCG commented 11 months ago

At work we have been able to use pyinstaller together with open3D, in the spec file we had to add the resources from open 3D a = Analysis( ... bear in mind other dependencies your project may have binaries=[.... ('...../anaconda3/envs/qserie/Lib/site-packages/open3d/resources', 'open3d/resources'),....

hrimov commented 9 months ago

Hi @JuanIgnacioCG can you please share the .spec file that produces the working executable? I also have issues with the bundling Open3D application using PyInstaller (Windows). I also tried your advice with the passing the open3d/resources, but I have not succeed with that. I have such error, that describes that something bundled incorrectly.

File "open3d\__init__.py", line 97, in <module>
ImportError: DLL load failed while importing pybind: A dynamic link library (DLL) initialization routine failed.
Alex-Dee commented 9 months ago

I solved the issue by manually adding all missing binaries and the resource folder of open3d in pyinstaller's .spec file. a = Analysis( ... e binaries=[.... ('...../site-packages/open3d/libc++.so.1", "open3d"), ...., ]