简体   繁体   English

heroku安装python 3.6.2而不是python 2.7

[英]heroku installing python 3.6.2 instead of python 2.7

I have written a python 2.7 based flask app, however when I push it to heroku using git push heroku master i see in termonal that it installs python version 3.6.2 instead of python version 2.7. 我已经编写了一个基于python 2.7的flask应用程序,但是当我使用git push heroku master将其推送到heroku时,我在终端上看到它安装的是python 3.6.2版本而不是python 2.7版本。

how should I fix this and why is it picking python 3.6 ? 我应该如何解决这个问题,为什么要选择python 3.6?

Newly created Python applications in heroku will be default to the Python 3.6.2 .. so if you want to specify a version of Python to be used to run your application. 在heroku中新创建的Python应用程序将默认为Python 3.6.2 ..因此,如果您想指定用于运行应用程序的Python版本。

This functionality is enabled by the presence of a runtime.txt file. 存在runtime.txt文件可启用此功能。

mohi@dev:~$ vi runtime.txt
mohi@dev:~$ cat runtime.txt
python-2.7.13

If you specify a different Python runtime than a previous build, your application's build cache will be purged. 如果您指定的Python运行时不同于先前的构建,则将清除应用程序的构建缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM