在 Ubuntu 上安装 ROS



我正在尝试在Ubuntu上安装ROS,但一直遇到以下错误。谁能建议如何克服这个问题?

==> Building with env: '/home/USER/ros_catkin_ws/install_isolated/env.sh'
==> cmake /home/USER/ros_catkin_ws/src/orocos_kinematics_dynamics/python_orocos_kdl -DCMAKE_INSTALL_PREFIX=/home/USER/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G Unix Makefiles in '/home/USER/ros_catkin_ws/build_isolated/python_orocos_kdl/install'
Traceback (most recent call last):
File "/home/USER/ros_catkin_ws/src/orocos_kinematics_dynamics/python_orocos_kdl/cmake/FindSIP.py", line 8, in <module>
import sipconfig
ImportError: No module named sipconfig
CMake Error at cmake/FindSIP.cmake:63 (MESSAGE):
Could not find SIP
Call Stack (most recent call first):
CMakeLists.txt:14 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/USER/ros_catkin_ws/build_isolated/python_orocos_kdl/install/CMakeFiles/CMakeOutput.log".
<== Failed to process package 'python_orocos_kdl': 
Command '['/home/USER/ros_catkin_ws/install_isolated/env.sh', 'cmake', '/home/USER/ros_catkin_ws/src/orocos_kinematics_dynamics/python_orocos_kdl', '-DCMAKE_INSTALL_PREFIX=/home/USER/ros_catkin_ws/install_isolated', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1
Reproduce this error by running:
==> cd /home/USER/ros_catkin_ws/build_isolated/python_orocos_kdl && /home/USER/ros_catkin_ws/install_isolated/env.sh cmake /home/USER/ros_catkin_ws/src/orocos_kinematics_dynamics/python_orocos_kdl -DCMAKE_INSTALL_PREFIX=/home/USER/ros_catkin_ws/install_isolated -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles'```

可能发生的情况是安装了sipconfig,但针对的是不同版本的 Python(即不是 Python 2.7(。您可以通过在 Python 2.7site-packages目录中创建指向sipconfig.py的链接来解决此问题,如下所示:

ln -s /usr/local/Cellar/sip/4.19.21/lib/python3.7/site-packages/sipconfig.py /usr/local/lib/python2.7/site-packages/sipconfig.py

注意:这在macOS上是成功的,因此在Ubuntu上的文件路径可能不同 - 特别是第一个(源文件(。


要检查这是否确实是问题所在,请执行以下操作:

尝试在 Python 2.7 和 Python 3 shell 中执行以下导入语句。如果它在 2.7 和 3 中都失败了,那么不幸的是这不是您的问题。

import sipconfig

最新更新