Briefly summarize the issues you have been experiencing.
I want to use python 3.7. I have a runtime.txt in the root of my folder. My base directory is ./documentation.
This runtime.txt has no effect.
7:06:04 PM: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Please provide a link to your live site hosted on Netlify
You’re right, some files, like the netlify.toml and runtime.txt need to be in the root of your repo. Sorry about the lack of documentation! We’ll work on that.
7:06:04 PM: DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
even though, as you can see, runtime.txt is in the root.
Hi @talha131, you may have better reliability with your python install if you use the Trusty build image instead of Xenial. I’m not sure what you’re doing in the publish-netlify script but I’m glad you found a solution.
Today we reviewed this situation with our documentation team and discovered a few things:
I think Gerald’s assertion about runtime.txt in the root was wrong - you do indeed need it in the base directory and that worked in my tests on both build images.
since we never saw your build logs as to what this looked like:
Moving runtime.txt inside base folder kills the build prematurely
…it’s a bit hard to speculate as to what happened. In my tests, that did not happen (basedir/runtime.txt contained the string 3.5 and my build logs showed:
10:42:05 AM: Python version set to 3.5
and the build completed as usual. If you wanted we’d be happy to take a look at some failed build logs to help track down that problem?