ping / instagram_private_api

A Python library to access Instagram's private API.
MIT License
2.99k stars 619 forks source link

ImportError: cannot import name Client #248

Closed sleiter88 closed 4 years ago

sleiter88 commented 4 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Which client are you using?


Describe your Question/Issue:

When I'm trying to use the web api python throw me an error "ImportError: cannot import name Client"


Paste the output of python -V here: Python 2.7.17

Code:

import instagram_web_api
"highlight:18031606450087811"

user_name = 'xxxxxxxxxxx'
password = 'xxxxxxxxxxx'

# Some endpoints, e.g. user_following are available only after authentication
authed_web_api = instagram_web_api.Client(
    auto_patch=True, authenticate=True,
    username=user_name, password=password)

following = authed_web_api.highlight_reels('2719560079')
print following

Error/Debug Log:

Traceback (most recent call last):
  File "instagram_web_api.py", line 1, in <module>
    import instagram_web_api
  File "/Users/jorgefaridpalenciafernandez/projects/testing/instagram_private_api/instagram_web_api.py", line 7, in <module>
    from instagram_web_api import Client, ClientCompatPatch, ClientError, ClientLoginError
ImportError: cannot import name Client
wlerin commented 4 years ago

Did you install it properly? Either by following the installation instructions or running pip install -e . in the cloned repo?

sleiter88 commented 4 years ago

Did you install it properly? Either by following the installation instructions or running pip install -e . in the cloned repo?

It works great with instagram_private_api so yes, I think I've installed it properly.

wlerin commented 4 years ago

That doesn't answer my question.

.../projects/testing/instagram_private_api/instagram_web_api.py

Are you trying to run this inside the cloned repo? Again, install it properly.

sleiter88 commented 4 years ago

That doesn't answer my question.

.../projects/testing/instagram_private_api/instagram_web_api.py

Are you trying to run this inside the cloned repo? Again, install it properly.

Ok, that was the problem, changing de filename solved the problem. Thanks so muchas for the help!!!