小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
ros2 run 的时候出错,节点无法运行
-
Traceback (most recent call last):
File "/home/honor/town_ws/src/install/village_li/lib/village_li/node", line 33, in <module>
sys.exit(load_entry_point('village-li==0.0.0', 'console_scripts', 'node')())
File "/home/honor/town_ws/src/install/village_li/lib/village_li/node", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/honor/town_ws/src/install/village_li/lib/python3.10/site-packages/village_li/li4.py", line 2, in <module>
from rclpy import Node
ImportError: cannot import name 'Node' from 'rclpy' (/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/init.py)
[ros2run]: Process exited with -
@哒哒利鸭 from rclpy.node import Node