Home
Support Forums

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"

https://app.netlify.com/sites/commanddotnet/

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.

https://app.netlify.com/sites/commanddotnet/deploys/6192c9bd59d5580008860ead

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

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"