Downgrade flask for discord bot web hosting

I’ve been following Code a Discord Bot with Python - Host for Free in the Cloud - YouTube (Code a Discord bot with Python - Host for free in the cloud), and have hit an issue with importing flask for the keep_alive function.
When I run the function, I get the following in my console:
“ Package operation failed”
Along with a pretty lengthy paragraph telling me that my replit version is too old for the current flask version, or that flask is too new to replit (same thing really).
I had a look online and found the following code which would in theory force the code to import a specific version of a library, but it hasn’t worked.

__requires__= "flask==1.1.4"
import pkg_resources
from flask import Flask

any help would be greatly appreciated!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.