Serverless functions: "Installing required dependencies" every single time

Hello,

I am trying to use Python Serverless functions. I am running vercel dev --debug. The website loads. However, every time that I do an action that calls the Python API from the frontend, Vercel displays “Installing required dependencies…”. Even without reloading the page, just clicking again the button that calls the API. It seems therefore that Vercel is not using the cache in .vercel/cache.

This happens every time, which is annoying because the dependencies also take quite a long time to install (I don’t know why, if I don’t use vercel and just do pip install -r requirements.txt it is much faster. It seems that my CPU is also barely used during Vercel’s “Installing required dependencies…”).

Deployment URL or Custom Domain:
Environment (local, preview, production): local

Thanks for reaching out about this, @astlaan. I don’t know the answer myself, but I’ll check with the CLI team and let you know what they say! :smile:

1 Like

The CLI team confirmed that this is currently expected behavior, but they’re planning some work to improve Python support to make this experience better

1 Like

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