master_api.py exists, but rosmaster cannot locate it
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?