ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

Python segfaults on OS X.10 with Indigo and brew

asked 2014-11-27 03:21:21 -0600

Michael gravatar image

Hello all,

I've installed ROS indigo, following the standard install on the site, on a Mac OS X 10 (Yosemite). Whenever I try to run python scripts such as rostopic or rosrun rqt_graph rqt_graph, I get the following error:

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

I understand that this has something to do with conflicting python versions between Homebrew and Mac OS X. Is there anything I can do now, short of re-installing ROS again?

Thanks!

edit retag flag offensive close merge delete

Comments

Having the same issue.

Tom Moore gravatar image Tom Moore  ( 2014-11-27 08:21:13 -0600 )edit

Unfortunately I think you need to recompile everything, since all the packages which built against Python need to be built using the headers from the Python interpreter you're going to link against.

William gravatar image William  ( 2014-11-27 08:21:44 -0600 )edit

@William: I rebuilt everything just now, but am getting the same error. Do I need to do something with Python before recompiling? I tried doing a brew reinstall boost --with-python before building.

Tom Moore gravatar image Tom Moore  ( 2014-11-27 09:38:22 -0600 )edit

@Tom Moore, I'm not sure, did you uninstall the Homebrew Python? or are you rebuilding because you now have the Homebrew Python?

William gravatar image William  ( 2014-12-02 07:36:21 -0600 )edit
1

I'm sorted now, thanks. I missed a step in the OS X instructions:

"Note: It is recommended to use the system python rather than homebrewed python because of problems with segmentation faults. http://answers.ros.org/question/10843...

Tom Moore gravatar image Tom Moore  ( 2014-12-02 09:26:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-07-17 16:46:49 -0600

lubiluk gravatar image

In order to fix the problem, brew-python vs system-python, you can add the following options to catkin_make_isolated. This will tell CMake to link against brew-python.

-DPYTHON_INCLUDE_DIR="/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Headers"
-DPYTHON_LIBRARY="/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib"

Adjust the paths to match your version of python.

edit flag offensive delete link more

Comments

A similar strategy is shown at https://github.com/mikepurvis/ros-ins...

m_jaeyoon_c gravatar image m_jaeyoon_c  ( 2018-07-14 17:11:11 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2014-11-27 03:21:21 -0600

Seen: 2,181 times

Last updated: Jul 17 '17