Conflict between Cloudflare Workers checks & Cloudflare docs
I'm using Python for my Worker, and This Cloudflare page described that I can use
aiohttp
package, but when i include that package along with fastapi
in requirements.txt
, I have the error: " found in requirements.txt. Note that requirements.txt should contain package names only, not version specifiers.
I tried many ways to remove the error:
- Remove the requirements.txt
, after that my Worker return ModuleNotFoundError
error
- Add packages back requirements.txt
(or even empty the file), after that Wrangler still said " found in requirements.txt. Note that requirements.txt should contain package names only, not version specifiers.
- Try to ignore the above error, now Cloudflare Workers return error You cannot yet deploy Python Workers that depend on packages defined in requirements.txt.
But that Cloudflare page link above has intruction for the use of requirements.txt
. So how can I use packages that supported by that page (fastapi
and aiohttp
)?9 Replies
What do your imports look like? You shouldn't need a requirements.txt file to import the built-in packages
Thanks for your very fast help! And this is how I import modules in my code:
can you try
instead?
I tried it
Interessant - I'm giving it a spin locally now
yup, I'm running into the same issue when deploying the CloudFlare examples from https://developers.cloudflare.com/workers/languages/python/packages/fastapi#get-started
lol
I have no idea why
š¢
I think they just aren't ready yet - it does seem to imply that fastapi is a built-in package but maybe it isnt yet
for now i guess developing it locally is the only option
Okay ty
GitHub
š BUG: Python workers cannot deploy correctly when using FastAPI Ā· ...
Which Cloudflare product(s) does this pertain to? Workers for Platforms What version(s) of the tool(s) are you using? wrangler 3.50.0 What version of Node are you using? 21.7.2 What operating syste...