Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import requests_oauthlib

I've failed to import requests_oauthlib, although I've installed it successfully:

$ sudo pip install requests requests_oauthlib
Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): requests-oauthlib in /usr/local/lib/python2.7/site-packages
Cleaning up...
~ alex$ python
Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from requests_oauthlib import OAuth1Session
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named requests_oauthlib

update:

>>> import sys; print sys.path
['', '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
like image 745
Incerteza Avatar asked Nov 30 '22 01:11

Incerteza


1 Answers

I had this issue and in addition to making sure the correct path was set, I found that running $ pip install requests requests_oauthlib solved the issue, as oauthlib is not included in the core requests library.

https://github.com/requests/requests-oauthlib

like image 118
joshi123 Avatar answered Dec 04 '22 03:12

joshi123