ModuleNotFoundError in Exercise 4.3

Can anyone please give me any suggestions on the possible solutions to this error? I tried several ways to change every file, but it still shows the ModuleNotFoundError, even if I restarted a new package and only used the given solutions… Thank you!

Hi @fanxing048 ,

Welcome to this Community!

Please follow this post to solve your problem: Module not found error in ROS basics in 5days (Python)

Regards,
Girish


After trying this it works! Could you please explain a little bit about what happened? I would like to know what possible wrong steps I’ve made. Thank you!

Hi @fanxing048 ,

From this screenshot, I understand that your catkin_make failed.
The reason usually is that you made changes to the package files that were not overwritten during the compile stage. The easiest way to fix that issue will be to delete all the compiled files and recompile from scratch. That way any files that needs to be overwritten will be freshly copied.

So, there is nothing wrong that you did. It was a fault in the compilation process itself.

So, in the future, if you get the same error (and you are sure that your files are correct), then all you have to do is just delete the build and devel folders and recompile from scratch. That will fix the issue.

Regards,
Girish

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.