Python3.8是什么:错误!无法在Vercel上找到运行时python3.8的二进制python3.8

关于Python3.8是什么的问题,在python3.8+中经常遇到, 当我在 vercel 上部署 django 应用程序时,我得到了这个错误

当我在 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"
        }
    ]
}

我被卡住了,所以有人帮我吗?

0

首先,您必须将运行时版本更改为 python 3.9 或 3.7。由于某些未知原因,vercel 上的 Python 3.8 似乎不起作用。

其次,其他人(包括我)使用了类似的 vercel.json 代码,因为 python 版本与 pip 不兼容,所以遇到了错误。解决方法是将构建器从 @ ardnt / vercel-python-wsgi 更改为 @ vercel / python。

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(241)
暗牧输出循环:将 for循环输出到数组中(98.1 the bash)
上一篇
终端运行python程序:如何在终端上运行Python脚本
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(36条)