Python build is not working anymore

Everything was working file until last week. It started breaking so I upgrade to python 3.8 but even that is failing. I also upgraded to focal image.

its failing with error /opt/build-bin/run-build-functions.sh: line 205: /opt/buildhome/pythonpython-3.8/bin/activate: No such file or directory

here’s pipfile

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
mkdocs = "==1.2.3"
mkdocs-material = "==7.3.6"
pymdown-extensions = "==9.0"
Pygments = "==2.10.0"
Markdown = "==3.3.4"

[requires]
python_version = "3.8"
9:40:08 AM: Build ready to start

9:40:10 AM: build-image version: 8925038cf853b22d6397cdcb9904ac88b66bb383 (focal)

9:40:10 AM: build-image tag: v4.5.0

9:40:10 AM: buildbot version: 0e1298c157b10f24ae5c9a9af08df22d0babb90a

9:40:10 AM: Fetching cached dependencies

9:40:10 AM: Failed to fetch cache, continuing with build

9:40:10 AM: Starting to prepare the repo for build

9:40:11 AM: No cached dependencies found. Cloning fresh repo

9:40:11 AM: git clone https://github.com/bilal-fazlani/commanddotnet

9:40:12 AM: Preparing Git Reference pull/383/head

9:40:12 AM: Parsing package.json dependencies

9:40:12 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'site' versus 'site/' in the Netlify UI

9:40:13 AM: Starting build script

9:40:13 AM: Installing dependencies

9:40:13 AM: /opt/build-bin/run-build-functions.sh: line 205: /opt/buildhome/pythonpython-3.8/bin/activate: No such file or directory

The better the post - the faster the answer.

Hey @bilal-fazlani,

I took a look at your recent builds and most of them seem successful and the ones that failed around the time you posted, had a different error in almost each one.

Are you still seeing this issue? if yes, do you mind linking us to the deploy that has this specific issue you mention?

here is an example failed build.

The recent build is passing because I am now using requirements.txt as a workaround. It is not working with pipfile. I would like to go back to using pipfile whenever that starts working again.

Your Pipfile uses Python 3.7: commanddotnet/Pipfile at e968016036f586a74f156dca1d52c73982cbbabf · bilal-fazlani/commanddotnet · GitHub

Netlify doesn’t use that as mentioned here: Netlify App

You can check the list here: build-image/included_software.md at focal · netlify/build-image · GitHub

You need to use Python 3.8

I have created a small test repo to reproduce this : Netlify App

Here, I am using python 3.8 with pipfile. It doesn’t work.
If I convert this into requirements.txt then it works

https://github.com/bilal-fazlani/netlify-test

netlify.toml

[build]
  publish = "site/"

  command = "mkdocs build"

Pipfile

[[source]] 
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages] 
mkdocs-material = "==8.0.2"

[requires] 
python_version = "3.8"

Hey @bilal-fazlani,

I could confirm this behaviour and have filed it for the team to look at:

Is this related? When using mkdocs build (and without any environment variables set), Netlify is trying to load Python 3.7:

9:41:06 AM: Installing dependencies
9:41:06 AM: /opt/build-bin/run-build-functions.sh: line 351: /opt/buildhome/python3.7/bin/activate: No such file or directory
9:41:06 AM: Error setting python version from runtime.txt

Can’t say for sure @jo81mj0y, could you share your site name?

Thanks. It’s https://super-starship-a6ef73.netlify.app.

Netlify currently only supports Python 2.7 and 3.8. Maybe try using Python 3.8 instead?