2014-09-04 25 views
7

Ich benutze TwitterAPI von Python (Ubuntu + Pycharm).kann nicht importieren is_secure_transport

Ich installiere TwitterAPI von "pip install networkx TwitterAPI". ich importieren nur TwitterAPI wie folgt:

from TwitterAPI import TwitterAPI 

Wenn ich die Python-Datei ausführen, Sie haben einen Fehler ist wie folgt:

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 

meine Python eine PyCharm wie folgt:

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

Ich kann immer noch nicht herausfinden, was ist falsch an meiner Umgebung?

+0

haben Sie für dieses Problem eine Lösung gefunden .. ?? – HadeS

Antwort

7

Verwenden Sie oauthlib-0.7.1, um das Problem zu beheben.

sudo pip install oauthlib --upgrade 
5

entfernen alte oauthlib Paket

apt-get remove python-oauthlib 

und installieren letzte oauthlib Version 0.7.1

pip install oauthlib -U