memoryshadow
CDCloudflare Developers
•Created by memoryshadow on 4/14/2024 in #workers-help
Python workers cannot deploy correctly when using FastAPI
I have recently written a worker in Python, but I have encountered trouble in the deployment:
I used FastAPI in my project following the tutorial, and it worked fine in my local environment, but I encountered a deadlock when I wanted to upload it. When I deployed the project following the example project, wrangler told me that requirements.txt is not currently supported. The original text I got was: "You cannot yet deploy Python Workers that depend on packages defined in requirements.txt. Support for Python packages is coming soon. [code: 10021]"
When I remove requirements.txt, it says: ModuleNotFoundError: No module named 'fastapi'. What should I do to properly publish the project?
See this issue for more technical details
4 replies