ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

master_api.py exists, but rosmaster cannot locate it

asked 2019-05-21 21:53:45 -0600

wan_da gravatar image

updated 2019-05-21 22:33:18 -0600

When I run roscore, i get this:

Traceback (most recent call last):
  File "/opt/ros/melodic/bin/roscore", line 36, in <module>
    from rosmaster.master_api import NUM_WORKERS
ImportError: No module named master_api

According to a post regarding the same error, I did this:

$ which python
/usr/bin/python
$ python --version
Python 2.7.15rc1
$ ls -al /opt/ros/melodic/lib/python2.7/dist-packages/rosmaster
drwxr-xr-x   2 root root  4096 May 22 10:15 .
drwxr-xr-x 138 root root 12288 May 22 10:16 ..
-rw-r--r--   1 root root  1707 Aug  7  2018 exceptions.py
-rw-r--r--   1 root root   450 Mar 19 02:55 exceptions.pyc
-rw-r--r--   1 root root  1698 Aug  7  2018 __init__.py
-rw-r--r--   1 root root   275 Mar 19 02:55 __init__.pyc
-rw-r--r--   1 root root  5411 Aug  7  2018 main.py
-rw-r--r--   1 root root  4032 Mar 19 02:55 main.pyc
-rw-r--r--   1 root root 37116 Aug  7  2018 master_api.py
-rw-r--r--   1 root root 33746 Mar 19 02:55 master_api.pyc
-rw-r--r--   1 root root  3102 Aug  7  2018 master.py
-rw-r--r--   1 root root  2133 Mar 19 02:55 master.pyc
-rw-r--r--   1 root root 14319 Aug  7  2018 paramserver.py
-rw-r--r--   1 root root 10630 Mar 19 02:55 paramserver.pyc
-rw-r--r--   1 root root 18575 Aug  7  2018 registrations.py
-rw-r--r--   1 root root 17901 Mar 19 02:55 registrations.pyc
-rw-r--r--   1 root root  8050 Aug  7  2018 threadpool.py
-rw-r--r--   1 root root  6688 Mar 19 02:55 threadpool.pyc
-rw-r--r--   1 root root  3159 Aug  7  2018 util.py
-rw-r--r--   1 root root  1907 Mar 19 02:55 util.pyc
-rw-r--r--   1 root root  8427 Aug  7  2018 validators.py
-rw-r--r--   1 root root  8646 Mar 19 02:55 validators.pyc

master_api.py exists, so why can't rosmaster locate it? is there a fix to this problem, like changing some path?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-05-22 19:56:22 -0600

vunguyen gravatar image

updated 2019-05-29 22:56:47 -0600

I had the same problem with my Kinetic on Ubuntu 16 after a recent upgrade/dist-upgrade. A work around is to rename or move roscore to something else.

sudo cp /opt/ros/$ROS_DISTRO/bin/roscore /opt/ros/$ROS_DISTRO/bin/roscore1

Hope this help until a better solution is found.

Edit 1: I had the issue fixed by reinstalling the rosmaster package.

sudo apt install --reinstall ros-$ROS_DISTRO-rosmaster
edit flag offensive delete link more

Comments

Thank you. Although I found that roslaunch works just fine, even though it starts another instance of roscore.

wan_da gravatar image wan_da  ( 2019-05-27 02:31:33 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-05-21 21:53:45 -0600

Seen: 526 times

Last updated: May 29 '19