How I fixed "Error: spawn python ENOENT" when upgrading

I run node-red in Docker and use the node-red-contrib-python-function node. My instance got stuck in a reboot loop when I upgraded to node-red 3 saying “Error: spawn python ENOENT.” Turns out this is because python is a unknown command and only python3 works.

First step was to launch bash inside the container despite the reboot loop. I did this by temporarily renaming my configuration directory and creating a new, empty one instead. After stopping the container, renaming the folder, and restarting the container, I could then launch bash with docker exec -it --user=root node-red bash. Once there, I just ran this command ln /bin/python /bin/python3. Once that’s done, stop node-red, rename your configuration folder to it’s original name, and start node-red again. That’s it, it should work now!