Project that's been stable for years has suddenly started failing "poetry: command not found"

This is my build script:

pip install poetry &&
poetry install &&
PYTHONPATH=`pwd` poetry run python myproject/manage.py freeze

Any ideas? Is there something fragile about this script that’s just broken due to a change in the build environment, or anything I should try to get it working again?

Ok, module invocation works as a quick fix (python -m poetry). Still, strange that it suddenly stopped working today after working fine for years?

The last successful build was at 2:24pm today and the first failed build was at 3:07pm (BST), so something must have changed in that half hour.

1 Like

Hi @johtso, thanks for reporting this! We’ve just released a change to Python version management in our build system today. It looks like you caught it before we even announced it. :slight_smile: It shouldn’t have changed any existing behaviours though. We’re looking into it now.

I’m happy you were able to find a workaround in the meantime!

1 Like

Ah, that makes sense! So seems like something’s stopping poetry installed using pip from appearing in the default path. Glad to hear you’re looking into it.

It does seem a bit unfortunate that things would change like this instead of there being a build environment update/deprecation process a la Heroku. It’s nice to know that your project will happily chug along without intervention, and that you can update things and fix any arising issues when it suits you.

Hey, @johtso, I’ve just reverted the canary rollout of the feature, so you should be unblocked. Can you give us more details on how to reproduce this locally and test for it? (Do you have maybe an open-source repo?)

Just for context, we are working on supporting newer Python versions. Currently, you can only use 2.7 and 2.8 on our Platform, which is already outdated. So, to provide you with the best experience possible, I’m in the process of enabling the use of any Python version you want. For example, if you prefer 3.12.6, you can go with it and are not limited to the two versions we provide.

This, of course, is not a small change, but it has changed how we install Python and pip. Therefore, we tested the rollout with a Canary version, and it seems it broke your site. Sorry for that; we are actively working on fixing it :slight_smile:

Experiencing the same issue, appreciate this command — adding it to my toml file allows my build to complete

2 Likes

Those all sound like great changes!

I just have the feeling that the build “runtime” should be versioned, and users should be able to upgrade to a new version if they want to take advantage of new language releases, but shouldn’t be pushed out to all users automatically. This obviously isn’t trivial, and I don’t know how Netlify’s infrastructure works when it comes to builds, but it seems quite important that the build environment stays consistent. It’s always very hard to know how a change will affect all the projects that are running out there.

I guess a reproduction would probably just be to have a blank project, and do “pip install poetry; poetry --version” as the build command.

1 Like