Python-Instagram API Example Not Working

I want to use the Python-Instagram package. I downloaded the package using a script that is provided at https://github.com/Instagram/python-instagram .

I tried to execute one of the scripts. However, I get the same error:ImportError: No module named client

from instagram.client import InstagramAPI

access_token = "YOUR_ACCESS_TOKEN"
api = InstagramAPI(access_token=access_token)
recent_media, next_ = api.user_recent_media(user_id="userid", count=10)
for media in recent_media:
     print media.caption.text

What is a module client and how to install it? I registered a client with IG.

+6
source share
4 answers

Did you put the name "instagram" in the file? This may be your problem.

Seeing this link that describes the same error, I realized my mistake.

+10
source

Recommended Method:

  • , pip
  • : pip install python-instagram ( /sudo )

:

InstagramAPI

from instagram.client import InstagramAPI
+2

, , instagram.py , , . , . .

+2

, ,

from InstagramAPI import InstagramAPI

, :

ImportError: No module named InstagramAPI

I was stupid enough to install InstagramAPI in one weng and used another venv to run my project ... yes

+1
source

All Articles