vercel: Python error when deploying

When i was deploying django app on vercel i got this error

Error! Unable to find binary python3.8 for runtime python3.8 Error! Check your logs at https://komputama-qj1unu7v1-ngapa.vercel.app/_logs or run vercel logs komputama-qj1unu7v1-ngapa.vercel.app

And the log in the deployment status is

[16:26:29.158] Retrieving list of deployment files… [16:26:31.764] Downloading 1726 deployment files… [16:26:38.432] Warning: Due to builds existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings [16:26:38.619] Installing build runtime… [16:26:42.087] Build runtime installed: 3.467s [16:26:42.423] Looking up build cache… [16:26:42.665] Build Cache not found [16:26:42.856] Starting build [16:26:42.861] Build AMI version: Amazon Linux release 2 (Karoo) [16:26:42.862] Lambda runtime: python3.8 [16:26:42.862] WSGI application: cores.wsgi.application [16:26:42.862] ====> Selecting python version [16:26:42.874] Error: Unable to find binary python3.8 for runtime python3.8 [16:26:42.874] at Object.findPythonBinary (/vercel/7c1ee15da2687191/.build-utils/.builder/node_modules/@ardnt/vercel-python-wsgi/build-utils/python.js:23:9) [16:26:42.874] at Object.exports.build (/vercel/7c1ee15da2687191/.build-utils/.builder/node_modules/@ardnt/vercel-python-wsgi/index.js:34:34) [16:26:42.874] at async mut (/var/task/sandbox.js:197:17526)

This is my ‘vercel.json’

{ “build”: { “env”: {

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

}

I got stuck with this, so anyone help me?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Hey @Ngapa use the official python runtime i.e.@vercel/python. add app = application end of cores/wsgi.py because the official python wants to expose the your wsgi/asgi application via appmore details on python runtime

@MayankSuthar1 go to vercel.com, pick a project and then go to Settings > General -> Node.js Version. Pick 18.x

Change node.js version to 18.x in project settings works for me.

thank you, that worked! no chance for me to come up with this 😄

image I also faced this same error and also i followed step provided by @prabincankod of adding app = application and setting python version to 3.9 , but still getting this issue. Also i am using the official @vercel/python Edit 1: This is the error WARN! Due to builds existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings 17:06:07.186 | Error: Unable to find any supported Python versions. 17:06:07.187 | Learn More: http://vercel.link/python-version Edit 2: Also I am using python 3.9.11 for the project

same error

Change node.js version to 18.x in project settings works for me.

Closing based on the last answer here, thanks everyone who helped. If you’ve got more questions then please contact support: https://vercel.com/help#issues thank you.