0
$\begingroup$

Rosanswers logo

Hi,

i recently tried to use Indigo on my notebook (Lenovo T440s). I tried the Install from source as well es the Install from repository methods to install a basic ROS Indigo. As long as i do not need to start a roscore on this machine pretty much everything works as expected. Connections to other machines, robots with roscore running work just fine.

As soon as i want to run a roscore it receive the following error:

./install_isolated/bin/roscore                                                                                                                                     :(
... logging to /home/bajo/.ros/log/a54a89fe-d5bd-11e3-9fec-28d244198e8b/roslaunch-roscosmos-3532.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 "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/__init__.py", line 279, in main
    p.start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 257, in start
    self._start_infrastructure()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 215, in _start_infrastructure
    self._start_server()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 166, in _start_server
    self.server.start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/roslaunch/server.py", line 352, in start
    super(ROSLaunchNode, self).start()
  File "/home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/rosgraph/xmlrpc.py", line 199, in start
    _thread.start_new_thread(self.run, ())
AttributeError: 'module' object has no attribute 'start_new_thread'

The same problem arises when i use the installation from the repository. The error messages just differ in terms of the paths.

source /opt/ros/indigo/setup.zsh                                                                        :(
bajo@roscosmos ~ % roscore                         
... logging to /home/bajo/.ros/log/e287ee68-d74a-11e3-ad4f-28d244198e8b/roslaunch-roscosmos-3568.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/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 279, in main
    p.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 257, in start
    self._start_infrastructure()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 215, in _start_infrastructure
    self._start_server()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 166, in _start_server
    self.server.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/server.py", line 352, in start
    super(ROSLaunchNode, self).start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/xmlrpc.py", line 199, in start
    _thread.start_new_thread(self.run, ())
AttributeError: 'module' object has no attribute 'start_new_thread'

As operating system i use Ubuntu 14.04 64bit and i have installed python 2.7 and 3.4. I am not sure if i installed both of them manually or if Ubuntu did this on its own. But the problem seems to happen because in /home/bajo/work/development/indigo/install_isolated/lib/python2.7/dist-packages/rosgraph/xmlrpc.py we try to import _thread and if this fails import thread. _thread is imported without errors, but does not contain the start_new_thread. After changing this to import thread as _thread roscore is able to start fine.

Edit

This is the thread import from the unmodified /opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/xmlrpc.py as installed by the package ros-indigo-rosgraph (1.11.0-1trusty-20140305-0350-+0000) from the repository.

try:
    import _thread
except ImportError:
    import thread as _thread

So my question is. Is just my installation of Ubuntu 14.04 so messed up that i am the only one to have this import conflict or is every Ubuntu installation going to face this issues?

Thank you for any answer.

bajo


Originally posted by bajo on ROS Answers with karma: 206 on 2014-05-06

Post score: 0


Original comments

Comment by joq on 2014-05-08:
roscore works for me, installed from the Ubuntu packages. Your example uses you manually compiled version. Try source /opt/ros/indigo/setup.bash followed by roscore.

Comment by bajo on 2014-05-08:
Thank you joq for your answer. Unfortunately the result is the same. I edited my original post to include the output from roscore which was installed from the repository. Can you please tell me which versions of python (2 and 3) you have installed on your system and what system you are running? Thank you.

Comment by joq on 2014-05-09:
Python versions: 2.7.6 and 3.4.0; should be the same on any up-to-date Trusty system. The _thread problem should only happen with python3. What does your /usr/bin/python point to?

Comment by joq on 2014-05-09:
There is something wrong with your environment. You are still resolving things to your hand-built workspace. Try creating a new shell with a clean environment (not sourcing your workspace, only /opt/ros/indigo/setup.zsh).

Comment by bajo on 2014-05-10:
I think it is not a problem with my ROS environment. I can even import _thread in my python2 interpreter, which is of course independent from ROS. Also in my edited post i have both versions. The hand-built as well as the on from the repository.

Comment by joq on 2014-05-10:
Please post the output of ls -l /usr/bin/python.

Comment by bajo on 2014-05-10:
ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Apr 5 17:23 /usr/bin/python -> python2.7*

Comment by joq on 2014-05-10:
Please post the values of $PYTHONPATH, $ROS_PACKAGE_PATH, and $CMAKE_PREFIX_PATH in your environment.

Comment by bajo on 2014-05-10:
echo $PYTHONPATH /opt/ros/indigo/lib/python2.7/dist-packages

echo $ROS_PACKAGE_PATH /opt/ros/indigo/share:/opt/ros/indigo/stacks

echo $CMAKE_PREFIX_PATH /opt/ros/indigo

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think i finally found the problem. A month ago I was playing around with a few vim plugins for python development. One of them seemed to place the file _thread.py at /usr/local/lib/python2.7/dist-packages/_thread.py. Through this it was available to python2.7 even though it was not meant to be used with it.

After I deleted the files /usr/local/lib/python2.7/dist-packages/_thread.py and /usr/local/lib/python2.7/dist-packages/_thread.pyc roscore is able to start without any problems.

Thank you joq for all your input and help on this matter. It is really nice to finally be able to use roscore again. :-)


Originally posted by bajo with karma: 206 on 2014-05-14

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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