Set AUTOCOMMIT to TRUE on account level in Snowflake.
Reposting @sriga's comment, which answered the question:
If you are changing the account parameter inside the stored procedure, it won't allow. Instead you can change the account level parameter by running Alter session set autocommit=True; else you can run your python script outside the snowflake and change the session parameters as mentioned in the below code
Snowflake enforces the prohibition on setting AUTOCOMMIT inside a stored procedure. Note that changing the AUTOCOMMIT behavior outside a stored procedure will continue to work.