Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'catkin_pkg' #118

Closed
jhwangbo opened this issue Dec 23, 2020 · 4 comments
Closed

ModuleNotFoundError: No module named 'catkin_pkg' #118

jhwangbo opened this issue Dec 23, 2020 · 4 comments
Labels
invalid This doesn't seem right question Further information is requested

Comments

@jhwangbo
Copy link

I followed the install instruction on Ros2 Eloquent. If call colcon build on my workspace, I get this error

ModuleNotFoundError: No module named 'catkin_pkg'

then I tried the instruction here https://colcon.readthedocs.io/en/released/user/installation.html but it didn't help.

I tried sudo apt install python3-catkin-* but it also doesn't work.

Here is the full error log

Starting >>> raisin_soem
--- stderr: raisin_soem                         
Traceback (most recent call last):
  File "/opt/ros/eloquent/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 21, in <module>
    from catkin_pkg.package import parse_package_string
ModuleNotFoundError: No module named 'catkin_pkg'
CMake Error at /opt/ros/eloquent/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:94 (message):
  execute_process(/home/jemin/.virtualenvs/raisim/bin/python3
  /opt/ros/eloquent/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py
  /home/jemin/ros_workspace/src/raisin/raisin_soem/package.xml
  /home/jemin/ros_workspace/build/raisin_soem/ament_cmake_core/package.cmake)
  returned error code 1
Call Stack (most recent call first):
  /opt/ros/eloquent/share/ament_cmake_core/cmake/core/ament_package_xml.cmake:49 (_ament_package_xml)
  /opt/ros/eloquent/share/ament_lint_auto/cmake/ament_lint_auto_find_test_dependencies.cmake:31 (ament_package_xml)
  CMakeLists.txt:33 (ament_lint_auto_find_test_dependencies)


---
Failed   <<< raisin_soem [0.30s, exited with code 1]
                                
Summary: 0 packages finished [0.42s]
  1 package failed: raisin_soem
  1 package had stderr output: raisin_soem
  1 package not processed
@jhwangbo
Copy link
Author

execute_process(/home/jemin/.virtualenvs/raisim/bin/python3
this line is very suspicious. It is calling python in my virtualenv. I might have my virtualenv active when I installed it. But clean install doesn't fix this.

@dirk-thomas dirk-thomas added invalid This doesn't seem right question Further information is requested labels Dec 31, 2020
@dirk-thomas
Copy link
Member

@jhwangbo Your Python environment seems to be off. You need to make sure that all necessary dependencies are available in the used Python environment. If you follow the official instructions you wouldn't have a virtualenv.

Since this is not a problem within colcon I am going to close this ticket. If you need further help troublehshooting your setup you probably get more eyes and feedback by asking on answers.ros.org (or checking for existing questions and answers on similar topics).

@jbrodovsky
Copy link

Hey, so following up on this as I had the same issue. As noted, it looks like you're using a virtual environment, so you need to install catkin_pkg into the environment. I'm using conda and I had to install catkin_pkg, empy, and lark:

conda install -c conda-forge catkin_pkg empy lark

@apocosipadrino
Copy link

@jbrodovsky you are a master mind... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Development

No branches or pull requests

4 participants