Reputation: 41
When I'm trying to execute this code,
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
I get this error.
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
But I have installed all these libraries -
linkedin,python-linkedin,requests,oauthlib
Why am I getting this error even though I have all the libraries installed?
Upvotes: 3
Views: 452
Reputation: 21
You have a conflict with your two linkedin libraries.
Both are called using your import linkedin
statement.
In order for it to work, you should uninstall the linkedin one, the LinkedInDeveloperAuthentication object being in the python-linkedin one using pip.
pip uninstall linkedin
Upvotes: 2