Error running *requests*
Question: Installed Python/Pip on OSX 10.10 using instructions here <http://docs.python-
guide.org/en/latest/starting/install/osx/>

Only installed to gain access to Pip

Installed requests using `pip install requests`

Ran script

    
    
    import requests
    
    feed_url = 'http://www.mylocation.com/the_data'
    
    #grab xml from URL
    r = requests.get(feed_url)
    r.text
    
    print r
    

Error is

    
    
    Traceback (most recent call last):
      File "get_all_listings.py", line 1, in <module>
        import requests
      File "/usr/local/lib/python2.7/site-packages/requests/__init__.py", line 58, in <module>
        from . import utils
      File "/usr/local/lib/python2.7/site-packages/requests/utils.py", line 12, in <module>
        import cgi
      File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cgi.py", line 50, in <module>
        import mimetools
      File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in <module>
        import tempfile
      File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in <module>
        import io as _io
      File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
        import _io
    ImportError: dlopen(/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
      Referenced from: /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
      Expected in: flat namespace
     in /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
    

Output from **otool -L $(which python)**

    
    
    /usr/local/bin/python:
        /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
    


Answer: `python` was point to the wrong version

Fixed by running `hash -d python`

