How to install tf2_geometry_msgs dependency PyKDL?
When importing tf2_geometry_msgs
in a Python script running a node in ROS Noetic
, I keep getting the following error indicating that I need to install PyKDL
.
Traceback (most recent call last):
File "/home/user/catkin_ws/devel/lib/my_package/my_node.py", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/user/catkin_ws/src/my_package/src/my_node.py", line 6, in <module>
import tf2_geometry_msgs
File "/opt/ros/noetic/lib/python3/dist-packages/tf2_geometry_msgs/__init__.py", line 1, in <module>
from .tf2_geometry_msgs import *
File "/opt/ros/noetic/lib/python3/dist-packages/tf2_geometry_msgs/tf2_geometry_msgs.py", line 31, in <module>
import PyKDL
ModuleNotFoundError: No module named 'PyKDL'
When I try to install PyKDL
using pip3 install PyKDL
, I get the following error:
Collecting PyKDL
Downloading PyKDL-1.4.0.tar.gz (1.5 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rtk9wxen/PyKDL/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rtk9wxen/PyKDL/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info
cwd: /tmp/pip-install-rtk9wxen/PyKDL/
Complete output (7 lines):
running egg_info
creating /tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info/PyKDL.egg-info
writing /tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info/PyKDL.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info/PyKDL.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info/PyKDL.egg-info/top_level.txt
writing manifest file '/tmp/pip-install-rtk9wxen/PyKDL/pip-egg-info/PyKDL.egg-info/SOURCES.txt'
error: package directory 'PyKDL' does not exist
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
This is frustrating because everything was working great yesterday and I'm unsure what has changed in my ROS
setup. My issue seems to be referenced in the Noetic Migration Guide here but it is not clear to me exactly what I need to do to install the required dependency.
Any ideas?
face same issue, any ideas?