ros-perception / vision_opencv

Apache License 2.0
536 stars 599 forks source link

ModuleNotFoundError: No module named 'catkin_pkg' #513

Open fatejzz opened 1 year ago

fatejzz commented 1 year ago

when I compile and install the cv_bridge ,it comes to an question that 'ModuleNotFoundError: No module named 'catkin_pkg'. However there is cv_bridge module in my python. I complie and install by following lines: cmake .. make sudo make install and the consoles shows:

**(base) [hkyunqi@hkyunqi-Train-Server build]$ sudo make install [ 0%] Built target std_msgs_generate_messages_py [ 0%] Built target sensor_msgs_generate_messages_cpp [ 0%] Built target sensor_msgs_generate_messages_eus [ 0%] Built target sensor_msgs_generate_messages_lisp [ 0%] Built target sensor_msgs_generate_messages_nodejs [ 0%] Built target sensor_msgs_generate_messages_py [ 0%] Built target geometry_msgs_generate_messages_cpp [ 0%] Built target geometry_msgs_generate_messages_eus [ 0%] Built target geometry_msgs_generate_messages_lisp [ 0%] Built target geometry_msgs_generate_messages_nodejs [ 0%] Built target geometry_msgs_generate_messages_py [ 0%] Built target std_msgs_generate_messages_cpp [ 0%] Built target std_msgs_generate_messages_eus [ 0%] Built target std_msgs_generate_messages_lisp [ 0%] Built target std_msgs_generate_messages_nodejs [ 50%] Built target cv_bridge [100%] Built target cv_bridge_boost Install the project... -- Install configuration: "" -- Installing: /usr/local/_setup_util.py -- Up-to-date: /usr/local/env.sh -- Up-to-date: /usr/local/setup.bash -- Up-to-date: /usr/local/local_setup.bash -- Up-to-date: /usr/local/setup.sh -- Up-to-date: /usr/local/local_setup.sh -- Up-to-date: /usr/local/setup.zsh -- Up-to-date: /usr/local/local_setup.zsh -- Up-to-date: /usr/local/.rosinstall -- Installing: /usr/local/lib/pkgconfig/cv_bridge.pc -- Up-to-date: /usr/local/share/cv_bridge/cmake/cv_bridge-extras.cmake -- Up-to-date: /usr/local/share/cv_bridge/cmake/cv_bridgeConfig.cmake -- Up-to-date: /usr/local/share/cv_bridge/cmake/cv_bridgeConfig-version.cmake -- Up-to-date: /usr/local/share/cv_bridge/package.xml

  • cd /home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge
  • mkdir -p /usr/local/lib/python3/dist-packages
  • /usr/bin/env PYTHONPATH=/usr/local/lib/python3/dist-packages:/home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/build/lib/python3/dist-packages: CATKIN_BINARY_DIR=/home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/build /home/hkyunqi/anaconda3/bin/python3 /home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/setup.py egg_info --egg-base /home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/build build --build-base /home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/build install --root=/ --install-layout=deb --prefix=/usr/local --install-scripts=/usr/local/bin Traceback (most recent call last): File "/home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/setup.py", line 3, in from catkin_pkg.python_setup import generate_distutils_setup ModuleNotFoundError: No module named 'catkin_pkg' CMake Error at catkin_generated/safe_execute_install.cmake:4 (message):

    execute_process(/home/hkyunqi/ros_workspace/catkin_ws2/src/bridge_detection/include/cv_bridge/build/catkin_generated/python_distutils_install.sh) returned error code Call Stack (most recent call first): cmake_install.cmake:156 (include)

make: * [Makefile:110:install] 错误 1

but there is that module in my python

(base) [hkyunqi@hkyunqi-Train-Server build]$ python
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import catkin_pkg