0

1) I built the visualizer but couldn’t launch it. Here is what I see:

(base) Taos-MacBook-Pro:drake taosun$ bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 0.988s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action

But when I tried to launch it, it didn't work:

(base) Taos-MacBook-Pro:drake taosun$ ./bazel-bin/tools/drake_visualizer
Traceback (most recent call last):
  File "/usr/local/opt/vtk@8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 5, in <module>
    from .vtkIOAMRPython import *
ImportError: dlopen(/usr/local/opt/vtk@8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMRPython.so, 2): Library not loaded: /usr/local/opt/hdf5/lib/libhdf5.103.dylib
  Referenced from: /usr/local/opt/vtk@8.2/lib/libvtkIOAMR-8.2.1.dylib
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/drakevisualizerapp.py", line 3, in <module>
    from director import mainwindowapp
  File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/mainwindowapp.py", line 2, in <module>
    from director.componentgraph import ComponentFactory
  File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/componentgraph.py", line 2, in <module>
    from director.fieldcontainer import FieldContainer
  File "/private/var/tmp/_bazel_taosun/faebfa4431921ca82cfb8e7cf6a74cad/external/drake_visualizer/lib/python3.7/site-packages/director/fieldcontainer.py", line 1, in <module>
    import vtk
  File "/usr/local/opt/vtk@8.2/lib/python3.7/site-packages/vtk.py", line 32, in <module>
    all_spec.loader.exec_module(all_m)
  File "/usr/local/opt/vtk@8.2/lib/python3.7/site-packages/vtkmodules/all.py", line 67, in <module>
    from .vtkIOAMR import *
  File "/usr/local/opt/vtk@8.2/lib/python3.7/site-packages/vtkmodules/vtkIOAMR.py", line 9, in <module>
    from vtkIOAMRPython import *
ModuleNotFoundError: No module named 'vtkIOAMRPython'

2) I also tried python-binding. The cmake and make completed successfully. However, when I tried to import pydrake, I got the below error:

(base) Taos-MacBook-Pro:GitHub taosun$ cd drake-build
(base) Taos-MacBook-Pro:drake-build taosun$ python3 -c 'import pydrake; print(pydrake.__file__)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/drake/lib/python3.7/site-packages/pydrake/__init__.py", line 41, in <module>
    from . import common
  File "/opt/drake/lib/python3.7/site-packages/pydrake/common/__init__.py", line 1, in <module>
    from ._module_py import *
ImportError: dlopen(/opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so, 2): Symbol not found: _PyThread_tss_alloc
  Referenced from: /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so
  Expected in: flat namespace
 in /opt/drake/lib/python3.7/site-packages/pydrake/common/_module_py.so

For both of the above two issues, I doubt whether it is because I don’t set $PYTHONPATH correctly. This is what I set at the moment

(base) Taos-MacBook-Pro:drake-build taosun$ echo $PYTHONPATH
/opt/drake/lib/python3.7/site-packages

Thank you for the help!

zsltg
  • 725
  • 5
  • 14
  • 23

1 Answers1

0

For the VTK error, try adding --define="-DUSE_SYSTEM_VTK=OFF" at the end of your build command.

bazel build //tools:drake_visualizer //manipulation/util:geometry_inspector --define="-DUSE_SYSTEM_VTK=OFF"`
Rufus
  • 5,111
  • 4
  • 28
  • 45