Pipenv: No such file or directory: '/opt/build/repo/docs/.venv/bin/python'

Hi team,

We recently had some issues building our MkDocs-based project managed by Pipenv: Mkdocs builds worked for past 2 months, now fails with: Command failed with exit code 127: mkdocs build - #20 by charlottechhum.

It seems like Pipenv-based builds recently broke again somewhere between Dec 16 and Dec 18: Netlify. Our latest successful build was on Dec 16.

10:48:15 PM: Installing dependencies from Pipfile
10:48:15 PM: To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
10:48:15 PM: Installing dependencies from Pipfile.lock (0e5749)...
[ ... ]
10:48:15 PM: FileNotFoundError: [Errno 2] No such file or directory: '/opt/build/repo/docs/.venv/bin/python'
10:48:15 PM: Error installing Pipenv dependencies
10:48:16 PM: Failed during stage 'Install dependencies': dependency_installation script returned non-zero exit code: 1
10:48:16 PM: Failing build: Failed to install dependencies

Mind you, this broke on its own, no changes were made on our end.

Netlify.toml is here: ebpf/netlify.toml at main · cilium/ebpf · GitHub. It’s as simple as can be:

[build]
  base = "docs/"
  publish = "site/"
  command = "mkdocs build"

Build settings, all stock/matching Netlify.toml:

Thanks,

Timo

Sorry for the direct ping, but ny thread was completely ignored. :frowning: @charlottechhum @lukas.holzer

Hi @ti-mo,

Thanks for reaching out! I sincerely apologize for failing to respond to your post.

Looking through the Deploy Log, I do see the failed build, although I do see that a Production build on January 27, 2025 was successful:

Where you able to resolve the issue?

Looking at the deploy log of the last failed build and the successful build, it looks like it started to have issues here:

The error you mentioned:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/build/repo/docs/.venv/bin/python'

Suggest that Pipenv was trying to activate a virtual environment, but I’m not sure why it is now successful in your latest successful build.

Hi @Melvin, thanks for the reply. Looks like this got fixed between Jan 15th and Jan 21st. I’ll close this for now and hope for no regressions. :slight_smile:

Our pipenv builds have been broken for more than a month in total since we started using Netlify early 2024, we’re considering to move our builds to GHA to have better control. Closing this, thanks again.