MacOS – Can’t install Python Modules

macospythonterminal

I'm running OSX 10.8.5 with python 2.7.10. When I run the following pip install pyodbc I get the following error message.

Error Message:

Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, tokenize;__file__='/private/var/folders/vy/13xnp2r52ls80mzhmcns__bm0000gp/T/pip-build-OUZxeg/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install –record /var/folders/vy/13xnp2r52ls80mzhmcns__bm0000gp/T/pip-BhOEZo-record/install-record.txt –single-version-externally-managed –compile" failed with error code 1 in /private/var/folders/vy/13xnp2r52ls80mzhmcns__bm0000gp/T/pip-build-OUZxeg/pyodbc

Xcode 5.1 is installed and pip list shows:

argh (0.26.1) 
html5lib (0.999999) 
pathtools (0.1.2) 
pip (7.1.0) 
PyYAML (3.11) 
setuptools (15.2) 
simplejson (3.8.0) 
six (1.9.0) 
wheel (0.24.0)

I'm pretty new to OS X so any help is welcome.

Best Answer

Problem sovled

This issue was caused because I had imported a time machine back which was made using snow lepoard. Doing this had overwrote the mountain lion libraries.

I just had to reinstall mountain lion over the existing install and then xcode and homebrew and it worked fine.