ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

import tf segfaults python on OS X 10.9 with brewed python

asked 2013-12-09 01:09:42 -0500

demmeln gravatar image

updated 2014-01-28 17:18:46 -0500

ngrennan gravatar image

I revently got the desktop-full variant of ROS hydro installed on Mac OS X 10.9 Mavericks. There were a series of smaller issues, e.g. most of the ones mentioned at, but in the end I got everything to compile.

When I start up python and type import tf, it crashes with

Segmentation fault: 11

My python version is 2.7.6 from homebrew. I don't even know how to start debugging this. Any help is greatly appreciated.


This seems to be caused by faulty cmake find_package(PythonLibs), which in turn caused by to be linked against apple's python, while I'm using brewed python. I opened this issue:

I guess the question that remains is if anybody else has the same issue. For me it is not isolated to tf, but all python modules that are built with find_package(PythonLibs) and link against the found python libs.


[moved to new question]


When used to be Edit2 is now a new question as suggested. Thanks.

edit retag flag offensive close merge delete


Unless you have a reason for using the Homebrew Python, I would highly recommend using the built-in Python, in my experience it causes far fewer issues.

William gravatar imageWilliam ( 2013-12-10 06:47:44 -0500 )edit

I think Edit2 above should be asked as a new question.

ahendrix gravatar imageahendrix ( 2013-12-13 13:13:32 -0500 )edit

I'm seeing the same segfault importing tf using a homebrewed python. It would be great if the Macosx install instructions explicitly recommended using the system python. I assumed that since homebrew was used for installing ROS, then using the homebrewed python would also be superior.

tlau gravatar imagetlau ( 2014-02-08 01:10:23 -0500 )edit

Can you edit the wiki to reflect that?

demmeln gravatar imagedemmeln ( 2014-02-11 01:27:57 -0500 )edit

Thank you!

demmeln gravatar imagedemmeln ( 2014-02-11 04:42:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-11 05:17:55 -0500

ahendrix gravatar image

I'm running Mavericks with the system python (2.7.5), and I don't have this problem.

Unless you know of a very specific reason that you need python 2.7.6 instead of 2.7.5, I strongly suggest removing your homebrew install of python and using the system version instead.

I would try this out by doing brew unlink python and confirm that the system python interpreter does what you want. You can then remove python with brew uninstall python or re-enable your homebrew python install with brew link python

edit flag offensive delete link more


I'll accept this since it sort of works around the issue. Beware that you have to reinstall various formulas, as well as pip packages and recompile ROS when switching python between brewed and system.

demmeln gravatar imagedemmeln ( 2013-12-15 23:45:11 -0500 )edit

I also get Segmentation fault when running stereo image proc on Mac OSX with system python. If someone have any ideas how to resolve it, will very appreciate it!

Artem gravatar imageArtem ( 2013-12-16 01:54:43 -0500 )edit

You should add a question for that specific problem. What does the OS X problem report state?

demmeln gravatar imagedemmeln ( 2013-12-16 03:51:07 -0500 )edit

I have had this problem for a long time on OSX. I am thinking about debugging it. I don't have the cameras around to try it. Will create a question soon. Thank you!

Artem gravatar imageArtem ( 2013-12-16 03:58:18 -0500 )edit

I wounder if this could ne related to this issue with message filters, since stereo image proc is using the approx time policy. You could try patching that header file locally.

demmeln gravatar imagedemmeln ( 2013-12-17 00:19:47 -0500 )edit

It looks like the problem was in the topic I was subscribing. Because my image_raw originally grayscale I should have subscribed to image_rect instead of image_rect_color. So no segmentation fault for now. :)

Artem gravatar imageArtem ( 2013-12-17 00:37:11 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2013-12-09 01:09:42 -0500

Seen: 4,201 times

Last updated: Dec 15 '13