Question

I am on osx-mavericks and I am encountering a Segmentation fault: 11 issue.

This SO post: Segmentation fault: 11 in OS X says that this could be caused by python 2.7.5

I attempted to upgrade python to the next version.

When I do

port installed | grep python

I see:

  python27 @2.7.6_0 (active)

However, when I run

python --version 

I get

 Python 2.7.5

It does the same behavior for python2.7 --version as well. Can anyone help me with this? How do I get python up to 2.7.6? Is it already there and just acting weird? Do I still have 2.7.5 on the machine somewhere? (Also, its worth noting I'm a bit new to the osx development environment)


Thanks to all.

I found the macports python at /opt/local/bin/python, whereas which python showed me /usr/local/bin/python. I changed the order in which these two directories are seen in my PATH and everything seems to work now.

Was it helpful?

Solution

OSX comes with python. It is likely that the version of python on your path is the out of box version. If you use

which python

you should get the directory location of the python you are calling and you can see if it is the macports or OSX version. The OSX Python on my 10.8 mac is in /Library/Frameworks/Python.framework .

Using Ned Deily's comment below you can find the location of the python you want to use from the terminal. Then you can add a line to your ~./bash_profile to set the PYTHONPATH to the version you want to use like this.

export PYTHONPATH=$PYTHONPATH:/path/to/your/python

Then you must reopen the terminal or source the .bash_profile.

source .bash_profile

Then use the which command again to make sure you have the version you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top