Python-Instagram API example not working

后端 未结 4 1574
感动是毒
感动是毒 2021-01-12 22:38

I am looking to use the Python-Instagram package. I have downloaded the package using the script that is provided on https://github.com/Instagram/python-instagram.

I

相关标签:
4条回答
  • 2021-01-12 23:11

    I just had this same problem and it turned out that I had file named instagram.py in the same package as the file where I was getting this error. So, it was just a name collision. I renamed my local file and everything worked fine.

    0 讨论(0)
  • 2021-01-12 23:30

    Did you put the name "instagram" on the file? This might be your problem.

    After seeing this link, which describes the same error, I realized my mistake.

    0 讨论(0)
  • 2021-01-12 23:31

    You may end up here like I did, and even by having

    from InstagramAPI import InstagramAPI
    

    and everything else correctly set I still got the error:

    ImportError: No module named InstagramAPI
    

    I was stupid enough to have InstagramAPI installed in one venv and was using another venv to run my project... dah

    0 讨论(0)
  • 2021-01-12 23:33

    The recommended way:

    1. Make sure you have pip installed
    2. Install the package with the command: pip install python-instagram (you may require administrator/sudo privileges for this)

    Manual Installation:

    1. Download the zip file from https://github.com/Instagram/python-instagram
    2. Copy the instagram directory to your python's dist-package directory or site-package directory (whatever is relevant to you)

    You should then be able to import InstagramAPI with

    from instagram.client import InstagramAPI
    
    0 讨论(0)
提交回复
热议问题