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 'urdf_tutorial.state_publisher' #6

Open
timf1 opened this issue Oct 24, 2021 · 3 comments
Open

Comments

@timf1
Copy link

timf1 commented Oct 24, 2021

Hi,

thanks for this tutorial.

I downloaded the package from repository, without changing nothing. But I get an error on "ros2 launch urdf_tutorial demo.launch.py"

if you have an idea.

[robot_state_publisher-1] [INFO] [1635090350.373655489] [robot_state_publisher]: got segment rod
[state_publisher-2] Traceback (most recent call last):
[state_publisher-2] File "/home/tim/ros2_foxy/install/urdf_tutorial/lib/urdf_tutorial/state_publisher", line 11, in
[state_publisher-2] load_entry_point('urdf-tutorial', 'console_scripts', 'state_publisher')()
[state_publisher-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 489, in load_entry_point
[state_publisher-2] return get_distribution(dist).load_entry_point(group, name)
[state_publisher-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2793, in load_entry_point
[state_publisher-2] return ep.load()
[state_publisher-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2411, in load
[state_publisher-2] return self.resolve()
[state_publisher-2] File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2417, in resolve
[state_publisher-2] module = import(self.module_name, fromlist=['name'], level=0)
[state_publisher-2] ModuleNotFoundError: No module named 'urdf_tutorial.state_publisher'
[ERROR] [state_publisher-2]: process has died [pid 25782, exit code 1, cmd '/home/tim/ros2_foxy/install/urdf_tutorial/lib/urdf_tutorial/state_publisher --ros-args -r __node:=state_publisher'].

Thanks

@benbongalon
Copy link
Owner

Hi, I'm not actively working on this project nowadays and so can't test it out. But from the error, the urdf_tutorial module was not found. Were you able to run these 2 commands succesfully before calling "ros2 launch"?

$ colcon build --symlink-install --packages-select urdf_tutorial
$ source install/setup.bash

@benbongalon
Copy link
Owner

benbongalon commented Oct 30, 2021 via email

@Danendra10
Copy link

Hi im facing the same issue

environment:
ubuntu 22
ros humble

In my colcon build i got this warning error

/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(

in another issue they say to run this pip cmd

pip3 install setuptools==60.7.0

But i still got that error

And when I run it i got this eror

[state_publisher-2] Traceback (most recent call last):
[state_publisher-2]   File "/home/clevero/second_ros2_ws/install/urdf_tutorial_r2d2/lib/urdf_tutorial_r2d2/state_publisher", line 33, in <module>
[state_publisher-2]     sys.exit(load_entry_point('urdf-tutorial-r2d2', 'console_scripts', 'state_publisher')())
[state_publisher-2]   File "/home/clevero/second_ros2_ws/install/urdf_tutorial_r2d2/lib/urdf_tutorial_r2d2/state_publisher", line 25, in importlib_load_entry_point
[state_publisher-2]     return next(matches).load()
[state_publisher-2]   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
[state_publisher-2]     module = import_module(match.group('module'))
[state_publisher-2]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[state_publisher-2]     return _bootstrap._gcd_import(name[level:], package, level)
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[state_publisher-2]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
[state_publisher-2] ModuleNotFoundError: No module named 'urdf_tutorial_r2d2'
[ERROR] [state_publisher-2]: process has died [pid 32542, exit code 1, cmd '/home/clevero/second_ros2_ws/install/urdf_tutorial_r2d2/lib/urdf_tutorial_r2d2/state_publisher --ros-args -r __node:=state_publisher'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants