gpt4 book ai didi

drake - drake build 和 "from pydrake.all import"的问题

转载 作者:行者123 更新时间:2023-12-04 09:35:57 26 4
gpt4 key购买 nike

我在使用 from pydrake.all import (MathematicalProgram, Polynomial) 时遇到问题从源代码构建 drake 之后(引用 https://drake.mit.edu/python_bindings.html)。根据上一个链接,安装步骤是:

git clone https://github.com/RobotLocomotion/drake.git
mkdir drake-build
cd drake-build
cmake ../drake -DWITH_MOSEK=ON
make -j
cd drake-build
export PYTHONPATH=${PWD}/install/lib/python3.6/site-packages:${PYTHONPATH}
安装运行后 from pydrake.all import (MathematicalProgram, Polynomial)我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "$HOME/drake-build/install/lib/python3.6/site-packages/pydrake/all.py", line 34, in <module>
from .perception import *
ImportError: ImportError: $HOME/drake-build/install/lib/python3.6/site-packages/pydrake/systems/framework.so: undefined symbol: _ZNK5drake7systems6SystemIdE19DoCheckValidContextERKNS0_11ContextBaseE
如果我使用每晚构建的二进制文件(而不是从源代码构建),我不会收到此错误,但是我在每晚构建的二进制文件中遇到了单独的问题,并且想要依赖从 git 构建。
使用 Ubuntu 18.04,Python3.6。

最佳答案

您是否尝试过设置 PYTHONPATH 环境变量?你可以做

cd drake-build
export PYTHONPATH=${PWD}/install/lib/python3.6/site-packages:${PYTHONPATH}
https://drake.mit.edu/python_bindings.html#building-the-python-bindings 中所述

关于drake - drake build 和 "from pydrake.all import"的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62585340/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com