2017-08-22 15 views
3

私はインポートエラー - LinkedInのAPI

from linkedin import linkedin 
from oauthlib import * 

authentication = linkedin.LinkedInDeveloperAuthentication(CONSUMER_KEY, 
           CONSUMER_SECRET, 
           USER_TOKEN, USER_SECRET, 
           RETURN_URL, 
           linkedin.PERMISSIONS.enums.values()) 

# Pass it in to the app... 

application = linkedin.LinkedInApplication(authentication) 

# Use the app.... 

g = application.get_profile() 
print g 

、このコードを実行しようとしている私は、このエラーを取得します。

ImportError        Traceback (most recent call last) 
<ipython-input-24-ec5bf07a1f1d> in <module>() 
    6 RETURN_URL = 'http://localhost:8000' 
    7 
----> 8 from linkedin import linkedin 
    9 from oauthlib import * 
10 

ImportError: cannot import name linkedin 

しかし、私はすべてのこれらのライブラリをインストールしている -

linkedin,python-linkedin,requests,oauthlib 

は、なぜ私はすべてのライブラリがインストールされているにもかかわらず、このエラーを取得していますか?

答えて

2

リンクされた2つのライブラリと競合しています。 どちらもimport linkedinステートメントを使用して呼び出されます。

これを機能させるには、linkedInDeveloperAuthenticationオブジェクトをpipでリンクされているPython-linkedinにアンインストールする必要があります。

pip uninstall linkedin