Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building and Using pydrake from source

Tags:

drake

I am simply trying to build and use pydrake from source. I have seen the Jupyter notebooks on how to use pydrake and they are helpful, but I would like to do this from source on my machine. I am unable to find instructions anywhere on how to build pydrake and use it from source. I have tried bazel build bindings/pydrake and then run

>>> import pydrake

from within the drake/bindings directory, but I get the error ModuleNotFoundError: No module named 'pydrake.common._module_py'. What is the usual workflow for building and then using the python bindings?

like image 475
cmoses Avatar asked Feb 28 '26 19:02

cmoses


1 Answers

You could follow the instruction on https://drake.mit.edu/python_bindings.html#building-the-python-bindings

Namely instead of build drake with bazel, you will need to do

mkdir drake-build
cd drake-build
cmake ../drake
make -j

and then set your PYTHONPATH accordingly.

like image 176
Hongkai Dai Avatar answered Mar 02 '26 14:03

Hongkai Dai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!