Question

Here is my code:

#!/bin/python3
# -*- coding: utf-8 -*-

from instagram.client import InstagramAPI

api = InstagramAPI(client_id='########', client_secret='######')
popular_media = api.media_popular(count=20)
for media in popular_media:
    print (media.images['standard_resolution'].url)

ive hidden cliend_id here as well as client_secret. when i run it i get the following error:

(insta1)pk@pk-900X3C-900X3D-900X4C-900X4D:~/Work/insta1$ python3 project1.py
Traceback (most recent call last):
  File "project1.py", line 4, in <module>
    from instagram.client import InstagramAPI
  File "/home/pk/Work/insta1/lib/python3.3/site-packages/instagram/__init__.py", line 1, in <module>
    from bind import InstagramAPIError, InstagramClientError
ImportError: No module named 'bind'

actually the module named bind.py is inside the instagram folder mentioned in the path so i don't understand what is wrong here.

The system is kUbuntu and python v is 3.3 as you can see from the error log. I am running my code in virtualenv with virtualenv 'insta1' set up but there is the same error when i try to run this kind of code without virtualenv.

I am new to python and am already struggling with this issue for 2 days already. please help.

Was it helpful?

Solution

This Instagram client library does not support Python 3.

You can try to repair that imports by substituting from bind import ... with from .bind import ... in instagram/__init__.py and other files, but then you will probably have other problems.

But if you fix them and upload to Github, that would be great :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top