Rosanswers logo

I was following this ROS tutorial https://www.youtube.com/watch?v=8ckSl4MbZLg&t=84s and got the following error:

roslaunch mybot_gazebo mybot_world.launch

... logging to /home/mallikarjun/.ros/log/47f3e6c2-6153-11e7-9730-9439e5050f5a/roslaunch-mallikarjun-Ideapad-Z570-21214.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last): File "/opt/ros/lunar/share/xacro/xacro.py", line 55, in import xacro File "/opt/ros/lunar/lib/python2.7/dist-packages/xacro/init.py", line 35, in import glob File "/home/mallikarjun/anaconda3/lib/python3.6/glob.py", line 4, in import re

ModuleNotFoundError: No module named 're'

Invalid tag: Cannot load command parameter [robot_description]: command [/opt/ros/lunar/share/xacro/xacro.py '/home/mallikarjun/mybot_ws/src/mybot_description/urdf/mybot.xacro'] returned with code [1].

Param xml is The traceback for the exception was written to the log file

Originally posted by mallikarjun.talagade on ROS Answers with karma: 23 on 2017-07-05

Post score: 2

Original comments

Comment by heyong on 2018-08-03:
hi,i have the same problem as it,How to solve this problem?thank you very much!


1 Answer 1


Rosanswers logo

The mixing of python 2.7 and 3.6 python files isn't good- you should have something like /usr/lib/python2.7/glob.py getting used instead of /home/mallikarjun/anaconda3/lib/python3.6/glob.py

It looks this isn't ROS related at all and you have installed anaconda3 into your home directory and need to keep it from being used. If there are lines in your .bashrc putting anaconda3 on your PATH or PYTHONPATH or any other references to anaconda3 try disabling those and start a new terminal

A quick test is running python from the command line and typing import re in:

>>> import re

and see if that produces the same error.

Originally posted by lucasw with karma: 8729 on 2017-07-05

This answer was ACCEPTED on the original site

Post score: 10

Original comments

Comment by mallikarjun.talagade on 2017-07-05:
Thank you very much. Problem solved. There were lines in .bashrc.

Comment by cydonia on 2017-07-05:
I have a very similar problem here. Do you think uninstalling Anaconda and reinstalling to another directory could be a solution as well?

Comment by cydonia on 2017-07-05:
And may I ask how exactly did you edit the .bashrc? the second line from the bottom looked like this at me: export PATH="/home/cydonia/anaconda3/bin:$PATH" and I made it export PATH="/home/cydonia:$PATH", but nothing changed.

Comment by lucasw on 2017-07-05:
Did you start a new terminal and launch the ros software in that one?

Comment by cydonia on 2017-07-05:
Just tried it and got another error, but then I run source /home/cydonia/turtlebot3_ws/devel/setup.bash and now the simulator is running! Thank you very much!

Comment by Sparkle Eyes on 2019-05-27:
Thanks, this solves the problem. I had to comment out everything that included conda in my ~/.bashrc. Also, source ~/.bashrc does not work, and I have to restart the terminal!

Comment by sujideevi on 2020-01-30:
I was breaking my head for the last 2 days. Finally, I landed on this page. Excluding 'anaconda3/bin' from $PATH resolved the issue. Thank you very much, guys!!!

Comment by pring on 2020-06-16:
Dangit - I have the same problem, and I need python3.6 to use openai gym with ...so simply not using python3 is not an option


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.