I know this is an old post but maybe this will still help someone.
Most libraries don’t know s3 file paths so it does not know how to interpret or use “s3:…”
You can try something like
from smart_open import open
Which will override the standard open() with smart open but if that doesn’t work you will need to write locally.
Also note that writing to s3 is much slower than writing locally.