No module named moveit_python

Hi

I am trying to execute exercise 5.7
I have copied the same code and executed it.
I got the following error: ModuleNotFoundError: No module named ‘moveit_python’

Am I missing anything here? Please guide me

Hi @SaiTeja104 ,

You need to use the rosrun <package_name> <executable_name> command to run that file instead of the python command.

Regards,
Girish

Hi @girishkumar.kannan

I’ve tried running the executable using rosrun command. Unfortuantely, I am facing the same error. I am trying in implement this for rbkairos robot in unit 4, not the fetch robot in unit 5.

Is the error because of that?

Hi @SaiTeja104 ,

I am assuming that the moveit_python dependency package is not available in the course environment.

You can install that by using the following commands:

sudo apt update

# python version
sudo apt install ros-noetic-moveit-python

# c++ version
sudo apt install ros-noetic-moveit-commander

This should fix your problem.

Regards,
Girish

Hi @girishkumar.kannan

Thanks for your response. I tried installing move_it python dependency but could successfully rin the command.

I have attached the image for your reference. Could you please guide me here.

Hi @SaiTeja104 ,

I am assuming that the ROS1 version installed in the course is older than noetic.

So follow the steps below to install the proper version of moveit_python:

  1. Check available ROS1 versions installed on your course environment:
    cd /opt/ros && ls
  2. You should see the installed ROS versions like below:
    crystal foxy galactic kinetic noetic
  3. Now choose the most recent ROS1 version (I am assuming that will be kinetic).
  4. Now install the moveit_python and moveit_commander packages for your ROS1 distribution:
    sudo apt update
    sudo apt install ros-kinetic-moveit-python
    sudo apt install ros-kinetic-moveit-commander
    

These steps should fix your issue.

Regards,
Girish

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