Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't import is_secure_transport

I am using TwitterAPI of python(ubuntu+pycharm).

I install TwitterAPI by "pip install networkx TwitterAPI". I just import TwitterAPI as follows:

from TwitterAPI import TwitterAPI

When I execute the python file ,there is a mistake as follows:

  File "/home/hanlu/PycharmProjects/cs579/a1.py", line 29, in <module>
    from TwitterAPI import TwitterAPI
  File "/home/hanlu/.local/lib/python2.7/site-packages/TwitterAPI/TwitterAPI.py", line 7, in <module>
    from requests_oauthlib import OAuth1
  File "/home/hanlu/.local/lib/python2.7/site-packages/requests_oauthlib/__init__.py", line 3, in <module>
    from .oauth2_auth import OAuth2
  File "/home/hanlu/.local/lib/python2.7/site-packages/requests_oauthlib/oauth2_auth.py", line 3, in <module>
    from oauthlib.oauth2 import is_secure_transport
ImportError: cannot import name is_secure_transport

my python an pycharm as follows:

>> python
python 2.7.7
>>import oauthlib
>>oauthlib__version__
  '0.6.3'

I still can't figure it out , what wrong with my environment?

like image 287
fhlkm Avatar asked Sep 04 '14 23:09

fhlkm


1 Answers

Use oauthlib-0.7.1 to fix the problem.

  sudo pip install oauthlib --upgrade
like image 68
Mehdi Behrooz Avatar answered Nov 03 '22 22:11

Mehdi Behrooz