ImportError: No module named moveit_commander

Issue #108 resolved
dan created an issue

Further investigation suggests this is unique to my docker setup. When I build the image, it indicates that pyassimp and ros-kinetic-moveit-commander are installed, but when I run the container and apt-get install ros-kinetic-moveit-commander it installs additional code and, after that, moveit_commander imports successfully.

Here is the result of apt-get install ros-kinetic-moveit-commander from the original build:

Collecting pyassimp
  Downloading pyassimp-3.3.tar.gz (94kB)
Installing collected packages: pyassimp
  Running setup.py install for pyassimp: started
    Running setup.py install for pyassimp: finished with status 'done'
Successfully installed pyassimp-3.3
Reading package lists...
Building dependency tree...
Reading state information...
libassimp-dev is already the newest version (3.2~dfsg-3).
libassimp-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 496 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libccd-dev libccd2 libfcl-0.5-dev libfcl0.5 libglew-dev libglew1.13
  python-bs4 python-chardet python-html5lib python-lxml python-pyassimp
  ros-kinetic-moveit-core ros-kinetic-moveit-kinematics
  ros-kinetic-moveit-msgs ros-kinetic-moveit-ros-manipulation
  ros-kinetic-moveit-ros-move-group ros-kinetic-moveit-ros-perception
  ros-kinetic-moveit-ros-planning ros-kinetic-moveit-ros-planning-interface
  ros-kinetic-moveit-ros-warehouse ros-kinetic-object-recognition-msgs
  ros-kinetic-octomap-msgs ros-kinetic-srdfdom ros-kinetic-urdfdom-py
  ros-kinetic-warehouse-ros
Suggested packages:
  glew-utils python-genshi python-lxml-dbg python-lxml-doc
The following NEW packages will be installed:
  libccd-dev libccd2 libfcl-0.5-dev libfcl0.5 libglew-dev libglew1.13
  python-bs4 python-chardet python-html5lib python-lxml python-pyassimp
  ros-kinetic-moveit-commander ros-kinetic-moveit-core
  ros-kinetic-moveit-kinematics ros-kinetic-moveit-msgs
  ros-kinetic-moveit-ros-manipulation ros-kinetic-moveit-ros-move-group
  ros-kinetic-moveit-ros-perception ros-kinetic-moveit-ros-planning
  ros-kinetic-moveit-ros-planning-interface ros-kinetic-moveit-ros-warehouse
  ros-kinetic-object-recognition-msgs ros-kinetic-octomap-msgs
  ros-kinetic-srdfdom ros-kinetic-urdfdom-py ros-kinetic-warehouse-ros
0 upgraded, 26 newly installed, 0 to remove and 496 not upgraded.
Need to get 6,764 kB of archives.
After this operation, 56.7 MB of additional disk space will be used.

Here is the result of apt-get install ros-kinetic-moveit-commander from the docker container, showing that it does not have moveit-commander installed. All the other moveit packages were installed. After this step, moveit_commander imports successfully.

Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python-pyassimp
The following NEW packages will be installed:
  python-pyassimp ros-kinetic-moveit-commander
0 upgraded, 2 newly installed, 0 to remove and 496 not upgraded.
Need to get 67.3 kB of archives.
After this operation, 345 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://packages.ros.org/ros/ubuntu xenial/main amd64 ros-kinetic-moveit-commander amd64 0.9.11-0xenial-20180125-180255-0800 [37.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 python-pyassimp all 3.2~dfsg-3 [30.0 kB]
Fetched 67.3 kB in 0s (151 kB/s)                      
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package python-pyassimp.
(Reading database ... 100503 files and directories currently installed.)
Preparing to unpack .../python-pyassimp_3.2~dfsg-3_all.deb ...
Unpacking python-pyassimp (3.2~dfsg-3) ...
Selecting previously unselected package ros-kinetic-moveit-commander.
Preparing to unpack .../ros-kinetic-moveit-commander_0.9.11-0xenial-20180125-180255-0800_amd64.deb ...
Unpacking ros-kinetic-moveit-commander (0.9.11-0xenial-20180125-180255-0800) ...
Setting up python-pyassimp (3.2~dfsg-3) ...
Setting up ros-kinetic-moveit-commander (0.9.11-0xenial-20180125-180255-0800) ...

This is the start of the original question:

In setting up the docker files for submission, I have encountered this error. I faintly recall seeing it when I was originally setting up my local system (which is working fine, so there must be some dependency I am missing in the bash setup). Searching ros.answers I find a lot of references to it being an issue, but was apparently resolved some time ago.

I re-checked the dependencies for moveit, as detailed in the ariac tutorial:

sudo apt-get install ros-kinetic-moveit-core \
                       ros-kinetic-moveit-kinematics \
                       ros-kinetic-moveit-ros-planning \
                       ros-kinetic-moveit-ros-move-group \
                       ros-kinetic-moveit-planners-ompl \
                       ros-kinetic-moveit-ros-visualization \
                       ros-kinetic-moveit-simple-controller-manager

and added ros-kinetic-moveit-commander as well as apt-get update and apt-get upgrade

The whole thing builds and moveit runs fine. But when I try to import moveit_commander into my planning program I get this error.

Some of the pages addressing this issue suggested upgrading pyassimp to version 3.3, so I added these lines to the build bash. It installed pyassimp version 3.3 but did not fix the error:

apt-get install python-setuptools
easy_install pip
pip install pyassimp

Anybody else encountering this?

Comments (6)

  1. dan reporter

    Looks like it is an issue with the docker image building rather than an overall system issue. That's consistent with it working fine on my computer but not within the docker image. I updated the question with that info.

  2. Deanna Hood

    The snippets you've provided are a bit limited, feel free to add full (censored) build/run output to a gist. The dependency might not be installed successfully but it's hard to tell from the snippets.

    To summarise what I have understood: you install a dependency in the build script, and it seems to get installed fine when you run prepare_team_system. But when you start a container from your team's image, rather than seeing that the package is installed, you instead see that it is not installed and must be installed again.

    Could you tell me the exact docker command you're running to start the container? It might be referencing the wrong image.

    Perhaps the image that you're using is accidentally out of date which is why it's missing the dependency. You're re-running the prepare_team_system script without using the --no-cache option, right?

    Does the following command output today's date?

    docker image inspect ariac-competitor-<your_team_team> | grep Created
    
  3. dan reporter

    Problem solved. I standardly use this line to install any dependencies I might have missed:

    rosdep install --from-paths src --ignore-src -r -y
    

    It seems that was messing up the moveit-commander installation for reasons I cannot fathom. In any case, removing that line solved the problem. It still complains that pyassimp is not installed, but that is a known issue that does not seem to bother the execution.

    Thanks for looking over the question so carefully. It was your request for a gist of the full console output that got me to simplify the build bash and thus discover the problem.

    It all has finally come together and from inside the docker execution yielded a full total game score of 9 on the sample.yaml configuration. Onward to doing the trial runs!

  4. Log in to comment