change response = pinata.pin_file_to_ipfs(filepath) To response = pinata.pin_file_to_ipfs(your_filepath)