遵循安装提示,但在键入后
$ python underactuated/src/double_pendulum/simulate.py
我明白了
ImportError:动态模块没有定义初始化函数(init_module_py)。
如果我运行 python3 我得到
ImportError:无法导入名称“FindResource”。
打字后$ python3 -c 'import pydrake; print(pydrake.__file__)'
我得到/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py
编辑: 运行 python3 的完整输出
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 5, in <module>
from underactuated import FindResource, PlanarSceneGraphVisualizer
ImportError: cannot import name 'FindResource'
以及运行python的完整输出(没有3):
Traceback (most recent call last):
File "underactuated/src/double_pendulum/simulate.py", line 1, in <module>
from pydrake.all import (AddMultibodyPlantSceneGraph,
File "/opt/drake/lib/python3.6/site-packages/pydrake/__init__.py", line 32, in <module>
from . import common
File "/opt/drake/lib/python3.6/site-packages/pydrake/common/__init__.py", line 3, in <module>
from ._module_py import *
ImportError: dynamic module does not define init function (init_module_py)
键入 python -V 后的 python 版本是Python 2.7.15+