账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    flask web app部署到 heroku时,提示python 版本不兼容。heroku仅支持python3.6.3?
    67
    0

    我的flask web APP 虚拟环境是python 3.5.3;
    runtime.txt:python3.5.3;requirements.txt和 Procfile文件都有;执行pip install -r requirements.txt没有报错。
    然而当我使用命令:git push heroku master 部署时出现:
    .....
    --->Python app detected

    The lastest version of python 3 is python-3.6.3(you are using Python-2.7.13,which is unsupported).
    We recommend upgrading by specifying the latest version(python-3.6.3).
    Learn more:https//devcenter.heroku.com/articles/python-runtimes

    --->Installing Python-2.7.13

    Requested runtime (Python-2.7.13) is not available for this stack(heroku-16).
    Aborting. More info:https://devcenter.heroku.com/articles/python-support
    Push failed
    ....

    .....
    请问这是怎么回事呢,我在这个虚拟环境中运行$:python -V, 确实显示的是python3.5.3,然后我改runtime.txt:python-3.6.3 还是报错,初次入坑 python flask web,请大家帮我看看,谢谢。

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 善良的大宝 普通会员 1楼

      Heroku不支持Python 3.6.3,因此需要升级Python版本。建议您使用Python 3.8或更高版本,或者在服务器上安装Python 3.6.3的编译器,如PyCharm。然后,您可以使用Python 3.8或更高版本的Python SDK来部署您的Web应用程序。如果您在服务器上安装了Python 3.6.3的编译器,那么您可以直接使用该编译器来部署您的Web应用程序。

    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部