VERCEL: Error: Unable to find any supported Python versions
Asked Answered
A

5

5

I'm trying to deploy some web apps with Python/Flask Vercel Templates and it's giving me an error in building:

Error: Unable to find any supported Python versions.

This has never happened before using vercel’s own templates.

build error:

build error

node version:

node version

I have seen previous reports that say about incompatibility with node 20.x, but the project is already configured with node 18.x

https://github.com/orgs/vercel/discussions/6287

I tried redeploying for 2 days in a row and out of curiosity, testing the python-hello-world template as well, which generated the same deploy error.

I have seen previous reports that say about incompatibility with node 20.x, but the project is already configured with node 18.x

Avocation answered 27/3 at 18:51 Comment(0)
P
4

Go to settings and change the nodejs version to 18.x. This works out to me and the docs has mentioned it. Because nodejs 20.x has some troubles with python 3.9 which needs to be fixed by vercel.

Phocis answered 1/4 at 14:39 Comment(0)
A
2

Editing "node" to 18.x package.json

{
  "engines": {
    "node": "18.x"
  }
}

editing the node version even if it is already pre-configured as 18.x seems to solve the problem, the strange thing is that I tried it and the first attempt it didn't work, while trying again today the app completed the build.

Avocation answered 27/3 at 19:10 Comment(0)
C
2
  • In the vercel.json file, you can specify the Python version like this:

    {
    "builds": [
      {
        "src": "vercel_app/wsgi.py",
        "use": "@vercel/python",
        "config": { "maxLambdaSize": "15mb", "runtime": "python3.8" }
      }
    ],
    "routes": [
      {
        "src": "/(.*)",
        "dest": "vercel_app/wsgi.py"
      }
    ]
    

}

Cliffhanger answered 28/3 at 3:14 Comment(0)
W
0

In my case the answer was changing vercel.json

{
  "rewrites": [
    { "source": "/(.*)", "destination": "/api/index" }
  ]
}

I changed source in it to this :

{
  "rewrites": [
    { "source": "/", "destination": "/api/index" }
  ]
}
Wallpaper answered 7/4 at 7:25 Comment(0)
A
0

Go on your github repository in package.json rewrite node version to "18.x" even tho it is already "18.x" and commit.

That will re run the build and it will work.

Af answered 10/4 at 17:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.