使用Python 2.7编译CV Bridge时发生错误

时间:2018-08-02 08:45:34

标签: python python-2.7 opencv ubuntu-14.04 ros

OS:Ubuntu 14.04。 我正在执行以下命令:

catkin_make -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

但是,使用Python 2.7编译CVbridge时发生以下错误:

Built target image_geometry
make[2]: *** No rule to make target /usr/lib/libpython2.7.so, needed by /home/kbad10/ros_catkin_ws/devel/lib/python2.7/dist-packages/cv_bridge/boost/cv_bridge_boost.so'.  Stop.
make[1]: *** [vision_opencv/cv_bridge/src/CMakeFiles/cv_bridge_boost.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

检查以下屏幕截图:

Error screenshot

Overall process that is being performed

3 个答案:

答案 0 :(得分:0)

您可能需要安装python开发库。使用

安装它们
  

sudo apt-get install python-dev

如果已经安装,请尝试使用此命令-

  

catkin_make -DPYTHON_EXECUTABLE = / usr / bin / python2 -DPYTHON_INCLUDE = / usr / include / python2.7 -DPYTHON_LIBRARY = / usr / lin / x86_64-linux-gnu / libpython2.7.so

答案 1 :(得分:0)

我不知道您从GitHub存储库中克隆了提交,但是合并了合并请求,它解决了您解决的相同问题Here

答案 2 :(得分:0)

要解决此问题,请在以下链接中修补(编辑)带有补丁的文件'cv_bridge / CMakeLists.txt': https://github.com/ros-perception/vision_opencv/pull/239/commits/9a9ad348abdfed010c70604cd964786f22220b30