Segmentation error when importing opencv in python with Mac OS X 10.7.5

I installed opencv 2.4.2 in python 2.7.1 and everything works. Now I upgraded python to 2.7.3 using the correct osx installer from python.org, and when I tried to import opencv, it tells me that there is no cv module (the same for cv2). So I updated opencv to 2.4.3, I did not get an error during installation, but when I try to import opencv, I get:

segmentation fault: 11 

I tried changing PYTHON_PACKAGES_PATH in the cmake file to fix the location (the old location does not exist), but I got the same error!

DECISION:

I founded the solution! I rollback to python 2.7.1 to do this in my home directory "/ Users / emanuel", I changed the .bash_profile file with the contents of .bash_profile.pysave, which was a backup file of my old bash. After installation, I have this circuit:

 export PYTHONPATH=/usr/local/lib/python2.7/site-packages/: # Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH export PYTHONPATH=/usr/local/lib/python2.7/site-packages/ 

I just deleted everything after the export command:

 export PYTHONPATH=/usr/local/lib/python2.7/site-packages/: 

Now everything works fine!

+6
source share

All Articles