collaborative-robotics / crtk_python_client

MIT License
9 stars 7 forks source link

ModuleNotFoundError: No module named 'wait_move_handle' #1

Closed linhongbin closed 3 years ago

linhongbin commented 3 years ago

Hi,

Currently I am testing python3 on ROS noetic, Ubuntu20.04.

I ran into a python error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ben/software/dvrk_ws/devel/lib/python3/dist-packages/crtk/__init__.py", line 34, in <module>
    exec(__fh.read())
  File "<string>", line 10, in <module>
ModuleNotFoundError: No module named 'wait_move_handle'

I found the solution to fix it in link.

So what I have fixed is replacing the lines in the file /home/ben/software/dvrk_ws/src/crtk/crtk_python_client/src/crtk/__init__.py:

# replace this line
# from wait_move_handle import wait_move_handle

# to this line
from .wait_move_handle import wait_move_handle
# replace this line
# from utils import utils

# to this line
ffrom .utils import utils

It runs perfectly after I modified the __init__.py and catkin build again.

adeguet1 commented 3 years ago

I must admit I'm not a Python expert and I have even less experience with Python 3. @linhongbin , do you happen to know if this is backward compatible with Python 2?

adeguet1 commented 3 years ago

Thank you for your report and solution. I tested it with 18.04/kinetic/python2 and 20.04/noetic/python3 and the code seems portable. This has been pushed to the "devel" branch and I hope to release 1.0.1 soon.

linhongbin commented 3 years ago

@adeguet1 Hi anton,

Sorry for the late reply. I think it should be backward compatible. Some reference I found is link and link.

By the way, as a dvrk python user I prefer to use Python3 since Python2 is no longer maintained. In addition, there are a lot of packages (such as pyqt5) not supporting Python2.

Cheers! :rocket: