You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/main.py", line 42, in <module>
main()
File "/main.py", line 36, in main
media = api.media_upload('test.png', file=h)
File "/tweepy/api.py", line 225, in media_upload
file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0]
File "/lib/python3.8/imghdr.py", line 16, in what
f = open(file, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'test.png'
The text was updated successfully, but these errors were encountered:
I tried to upload an image created in memory by using the file argument of
api.media_upload
code:
returns Error:
The text was updated successfully, but these errors were encountered: