[英]Error! Unable to find binary python3.8 for runtime python3.8 on Vercel
當我在 Vercel 上部署 django 應用程序時,出現了這個錯誤
錯誤。 無法找到運行時 python3.8 錯誤的二進制 python3.8! 在https://komputama-qj1unu7v1-ngapa.vercel.app/_logs或運行
vercel logs komputama-qj1unu7v1-ngapa.vercel.app
查看你的日志
部署狀態中的日志是
[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)
這是我的“vercel.json”
{
"build": {
"env": {
"SECRET_KEY": "SECRET_KEY",
"DEBUG": "True",
"DB_HOST": "DB_HOST",
"DB_NAME": "DB_NAME",
"DB_USER": "DB_NAME",
"DB_PORT": "DB_PORT",
"DB_PASSWORD": "DB_PASSWORD"
}
},
"builds": [{
"src": "cores/wsgi.py",
"use": "@ardnt/vercel-python-wsgi",
"config": { "maxLambdaSize": "15mb", "runtime": "python3.8" }
}],
"routes": [
{
"src": "/(.*)",
"dest": "cores/wsgi.py"
}
]
}
我被這個困住了,所以有人幫我嗎?
首先,您必須將運行時版本更改為 python 3.9 或 3.7。 Python vercel 上的 3.8 出於某種未知原因似乎無法正常工作。
其次,由於 python 版本與 pip 不兼容,使用過類似 vercel.json 代碼的其他人(包括我在內)遇到了錯誤。解決方法是從@ardnt/vercel-python-wsgi 更改構建器到@vercel/蟒蛇。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.