Click here to Skip to main content
15,917,859 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i run this code i get this error:


Traceback (most recent call last):
File "C:\Users\Me\Desktop\Instagram-API-python-master\examples\direct_share.py", line 12, in <module>
InstagramAPI.direct_share(mediaId, recipients, text='aquest es es darrer')
File "C:\Users\Me\AppData\Local\Programs\Python\Python37\lib\site-packages\InstagramAPI\InstagramAPI.py", line 389, in direct_share
if not isinstance(position, list):
NameError: name 'position' is not defined

please can someone help me!

What I have tried:

from InstagramAPI import InstagramAPI

InstagramAPI = InstagramAPI("myusername", "mypassword")
InstagramAPI.login()                        # login
mediaId = '1469246128528859780_1520706701'    
recipients = ["myotherusername"]                              
InstagramAPI.direct_share(mediaId, recipients, text='hello')
Posted
Comments
Richard MacCutchan 9-Sep-18 3:46am    
You need to look at the lines of code listed in the error messages. You have not shown either of them, but at a guess you are referring to a variable named position which has never been instantiated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900