python - Error running *requests* -
installed python/pip on osx 10.10 using instructions here http://docs.python-guide.org/en/latest/starting/install/osx/
only installed gain access pip
installed requests using pip install requests
ran script
import requests feed_url = 'http://www.mylocation.com/the_data' #grab xml 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> . 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 _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 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)
python
point wrong version
fixed running hash -d python
Comments
Post a Comment