# Workaround: the newest filelock release calls os.link in a way browser Python does not support, # so swap in an older filelock before gradio is imported import micropip try: micropip.uninstall("filelock") await micropip.install("filelock==3.16.1") except Exception as e: print("filelock reinstall skipped:", e) # Backup workaround: make os.link ignore the extra keyword argument import os _real_link = os.link def _link(src, dst, **kwargs): return _real_link(src, dst) os.link = _link import gradio as gr def greet(name): return "Hello " + name + "!" demo = gr.Interface(fn=greet, inputs="textbox", outputs="textbox") demo.launch()