Is Cloudflare using an older version of Netlify Build Image?

Building a Pelican-based project without setting PYTHON_VERSION emits the following error message:

2022-11-21T17:53:08.169615Z	Cloning repository...
2022-11-21T17:53:09.971475Z	warning: redirecting to https://gitlab.com/GROUP/PROJECT.git/
2022-11-21T17:53:09.972176Z	From https://gitlab.com/GROUP/PROJECT
2022-11-21T17:53:09.972367Z	 * branch            d691111a46a41111ea806011118708a6f8a4312f32 -> FETCH_HEAD
2022-11-21T17:53:09.972505Z	
2022-11-21T17:53:10.057607Z	HEAD is now at d69111 initial commit
2022-11-21T17:53:10.05814Z	
2022-11-21T17:53:10.201498Z	
2022-11-21T17:53:10.22971Z	Success: Finished cloning repository files
2022-11-21T17:53:10.971469Z	Installing dependencies
2022-11-21T17:53:10.984038Z	Python version set to 2.7
2022-11-21T17:53:14.516712Z	v12.18.0 is already installed.
2022-11-21T17:53:15.723746Z	Now using node v12.18.0 (npm v6.14.4)
2022-11-21T17:53:15.996208Z	Started restoring cached build plugins
2022-11-21T17:53:16.011712Z	Finished restoring cached build plugins
2022-11-21T17:53:16.532359Z	Attempting ruby version 2.7.1, read from environment
2022-11-21T17:53:20.33558Z	Using ruby version 2.7.1
2022-11-21T17:53:20.72949Z	Using PHP version 5.6
2022-11-21T17:53:20.72984Z	Installing pip dependencies
2022-11-21T17:53:20.730414Z	Started restoring cached pip cache
2022-11-21T17:53:20.843468Z	Finished restoring cached pip cache
2022-11-21T17:53:23.030939Z	DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
2022-11-21T17:53:24.483125Z	Collecting alabaster==0.7.12
2022-11-21T17:53:24.558064Z	  Downloading alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
2022-11-21T17:53:24.587172Z	Requirement already satisfied: appdirs==1.4.4 in /opt/buildhome/python2.7/lib/python2.7/site-packages (from -r requirements.txt (line 2)) (1.4.4)
2022-11-21T17:53:24.699688Z	ERROR: Could not find a version that satisfies the requirement astroid==2.12.13 (from -r requirements.txt (line 3)) (from versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6)
2022-11-21T17:53:24.700031Z	ERROR: No matching distribution found for astroid==2.12.13 (from -r requirements.txt (line 3))
2022-11-21T17:53:24.903139Z	WARNING: You are using pip version 20.2b1; however, version 20.3.4 is available.
2022-11-21T17:53:24.903446Z	You should consider upgrading via the '/opt/buildhome/python2.7/bin/python2.7 -m pip install --upgrade pip'

which clearly shows that Python version 2 has been used as the default version. But setting PYTHON_VERSION=3.8 emits the following error message:

2022-11-21T17:55:49.875884Z	Cloning repository...
2022-11-21T17:55:52.589207Z	warning: redirecting to https://gitlab.com/GROUP/PROJECT.git/
2022-11-21T17:55:52.589894Z	From https://gitlab.com/GROUP/PROJECT
2022-11-21T17:55:52.590082Z	 * branch            d691111a46a41111ea806011118708a6f8a4312f32 -> FETCH_HEAD
2022-11-21T17:55:52.590225Z	
2022-11-21T17:55:52.695339Z	HEAD is now at d69111 initial commit
2022-11-21T17:55:52.695898Z	
2022-11-21T17:55:52.952838Z	
2022-11-21T17:55:53.002117Z	Success: Finished cloning repository files
2022-11-21T17:55:53.856846Z	Installing dependencies
2022-11-21T17:55:53.88395Z	/opt/build/bin/run-build-functions.sh: line 168: /opt/buildhome/python3.8/bin/activate: No such file or directory
2022-11-21T17:55:53.884337Z	Error setting python version from the PYTHON_VERSION environment variable
2022-11-21T17:55:53.884518Z	Please see https://github.com/netlify/build-image/#included-software for current versions
2022-11-21T17:55:53.886463Z	Failed: build command exited with code: 1
2022-11-21T17:55:56.578386Z	Failed: an internal error occurred

Which tells me I have to consult Netlify repo:

Please see https://github.com/netlify/build-image/#included-software to check for available versions of python.

As can be seen here it says:

Python - PYTHON_VERSION, runtime.txt, Pipfile

3.8 (default)
2.7

Which is obviously not the case on Clouflare. Isn’t it probably the time to move away from python2 and set the default PYTHON_VERSION to an active version which receives security patches from upstream?

Yes, Pages uses an older version of the Netlify build image. The most recent python version that’s currently supported is 3.7.

Work is underway to update it, and you can follow the progress and share any thoughts you may have on the GitHub discussion below:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.