Ask Your Question
0

ImportError: No module named moveit_commander

asked 2018-03-13 02:10:14 -0600

dan gravatar image

updated 2018-03-13 11:03:53 -0600

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:

I was able to install moveit with binaries, as per the tutorial and it runs. However, when I try to use it in my own code, I get this error when importing moveit_commander.

ImportError: No module named moveit_commander

I am using Ubuntu 16.04 and ... (more)

edit retag flag offensive close merge delete

Comments

Just making sure: you're using regular, v2 python, right (python --version outputs something in the 2.x.y range). No Anaconda, etc?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-13 03:13:11 -0600 )edit

yes, python --version shows Python 2.7.12, no anaconda, but it is a docker build.

dan gravatar imagedan ( 2018-03-13 09:48:51 -0600 )edit

I edited the question, as I discovered that the problem has to do with the docker build rather than an overall system question. When building the docker image, it says it installs ros-kinetic-moveit-commander, but when the container is run, I have to install it again to make it work.

dan gravatar imagedan ( 2018-03-13 11:06:11 -0600 )edit

I'm confused: the first few lines of the "the original build" output shows (what appears to be) a pip installation of pyassimp. The rest shows apt-get output. Do you build MoveIt from sources?

gvdhoorn gravatar imagegvdhoorn ( 2018-03-13 11:06:47 -0600 )edit

moveit was installed from binaries. Apparently, pyassimp needs to be installed with pip. When I installed moveit-commander from inside the container, it installed both pyassimp and moveit-commander. For the docker build I tried it with and without the pip install and got the same import error.

dan gravatar imagedan ( 2018-03-13 13:44:26 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-13 14:33:46 -0600

dan gravatar image

updated 2018-03-14 00:16:58 -0600

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. I also removed the pip install of pyassimp. It still complains that pyassimp is not installed, but that is a known issue that does not seem to bother the execution.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-03-13 02:10:14 -0600

Seen: 1,242 times

Last updated: Mar 14 '18