Вызвать «make install -j8 -l8» не удалось - PullRequest
0 голосов
/ 12 января 2020

Я пытаюсь выучить ROS Tutorials в topi c "Создание ROS msg и srv", но в итоге я не могу $ catkin_make install

это результат:

snow@snow-PE60-2QE:~/catkin_ws$ catkin_make install
Base path: /home/snow/catkin_ws
Source space: /home/snow/catkin_ws/src
Build space: /home/snow/catkin_ws/build
Devel space: /home/snow/catkin_ws/devel
Install space: /home/snow/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/snow/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/snow/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/snow/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/snow/catkin_ws/devel;/opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/snow/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.5.2") 
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.20
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- beginner_tutorials: 1 messages, 0 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snow/catkin_ws/build
####
#### Running command: "make install -j8 -l8" in "/home/snow/catkin_ws/build"
####
Scanning dependencies of target _beginner_tutorials_generate_messages_check_deps_Num
Scanning dependencies of target std_msgs_generate_messages_eus
Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target std_msgs_generate_messages_py
Scanning dependencies of target std_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target _beginner_tutorials_generate_messages_check_deps_Num
Scanning dependencies of target beginner_tutorials_generate_messages_py
Scanning dependencies of target beginner_tutorials_generate_messages_lisp
Scanning dependencies of target beginner_tutorials_generate_messages_cpp
Scanning dependencies of target beginner_tutorials_generate_messages_nodejs
Scanning dependencies of target beginner_tutorials_generate_messages_eus
[ 28%] Generating C++ code from beginner_tutorials/Num.msg
[ 28%] Generating Python from MSG beginner_tutorials/Num
[ 42%] Generating EusLisp manifest code for beginner_tutorials
[ 57%] Generating Lisp code from beginner_tutorials/Num.msg
[ 71%] Generating Javascript code from beginner_tutorials/Num.msg
[ 85%] Generating EusLisp code from beginner_tutorials/Num.msg
[ 85%] Built target beginner_tutorials_generate_messages_lisp
[ 85%] Built target beginner_tutorials_generate_messages_nodejs
Traceback (most recent call last):
  File "/opt/ros/kinetic/share/genpy/cmake/../../../lib/genpy/genmsg_py.py", line 44, in <module>
    import genpy.generator
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/__init__.py", line 34, in <module>
    from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/genpy/message.py", line 44, in <module>
    import yaml
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 2, in <module>
    from error import *
ImportError: No module named 'error'
beginner_tutorials/CMakeFiles/beginner_tutorials_generate_messages_py.dir/build.make:62: recipe for target '/home/snow/catkin_ws/devel/lib/python3/dist-packages/beginner_tutorials/msg/_Num.py' failed
make[2]: *** [/home/snow/catkin_ws/devel/lib/python3/dist-packages/beginner_tutorials/msg/_Num.py] Error 1
CMakeFiles/Makefile2:567: recipe for target 'beginner_tutorials/CMakeFiles/beginner_tutorials_generate_messages_py.dir/all' failed
make[1]: *** [beginner_tutorials/CMakeFiles/beginner_tutorials_generate_messages_py.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 85%] Built target beginner_tutorials_generate_messages_cpp
[ 85%] Built target beginner_tutorials_generate_messages_eus
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make install -j8 -l8" failed

как можно решить это?

1 Ответ

0 голосов
/ 13 января 2020

Это может произойти, если вы перепутали две версии python (/opt/ros/kinetic/lib/python2.7 и /home/snow/catkin_ws/devel/lib/python3). Чтобы решить эту проблему, у вас есть два варианта:

  1. Используйте python3 при создании источника: catkin build --cmake-args -DPYTHON_VERSION=3.6. Вы можете найти больше информации здесь .

  2. Измените свой код, чтобы использовать python2. Для этого в первой строке вашего скрипта используйте «#! / Usr / bin / env python3» вместо «#! / Usr / bin / env python», но в этом случае вам может потребоваться разрешить python проблемы совместимости в вашем коде. О подобной проблеме сообщалось здесь .

...