I have installed the Open3D module using pip
into the interpreter of Blender 2.79b, which uses Python 3.5.3. If I open the Python interpreter from the system console everything works fine without any error message after importing the module.
However, if I open the embedded console of Blender and import Open3D I get the following error:
>>> import open3d
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "/opt/blender-2.79b-linux-glibc219-x86_64/2.79/python/lib/python3.5/site-packages/open3d/__init__.py", line 35, in <module>
from .open3d import * # py2 py3 compatible
ImportError: std::bad_cast
Furthermore, if I include something different before Open3D (eg, numpy) the error changes into this:
>>> import numpy
>>> import open3d
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "/opt/blender-2.79b-linux-glibc219-x86_64/2.79/python/lib/python3.5/site-packages/open3d/__init__.py", line 35, in <module>
from .open3d import * # py2 py3 compatible
ImportError: generic_type: cannot initialize type "VerbosityLevel": an object with that name is already defined
So far, I've tried Blender 2.79a, 2.79b and 2.80 with different versions of Open3D and numpy, but I'm not able to find a solution. Trying the newer Blender 2.80 (Python 3.7.0) the error changes again into:
>>> import open3d
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "/opt/blender-2.80-linux-glibc217-x86_64/2.80/python/lib/python3.7/site-packages/open3d/__init__.py", line 28, in <module>
from .open3d import * # py2 py3 compatible
ImportError: Invalid character class.
What could it be? Thanks.
Environment
OS: Ubuntu 18.04, Python version: 3.5.3 / 3.7.0, Open3D version: 0.8.0.0
Blender 2.79b is installed in /opt/blender-2.79b-linux-glibc219-x86_64
.
In order to install the package I ran the following commands:
cd /opt/blender-2.79b-linux-glibc219-x86_64
./2.79/python/bin/python3.5m 2.79/python/lib/python3.5/ensurepip
./2.79/python/bin/pip3.5 install open3d
Same commands for the 2.80 version.