R
Railway•14mo ago
lukasgjetting

Python not available after recent update(?)

Hiya! I've been deploying via Railway for almost a year now - and it's been great! Starting three days ago, all my builds are failing with the error message Python is not set from command line or npm configuration while building node-gyp. I am deploying JS using yarn. Did a recent update to Railway change anything? Is the default image now more lightweight, meaning Python isn't included? And if so, is there a way to do this while avoiding a custom Dockerfile? I could try to guess the python location and set it as an environment variable, but that seems very brittle... Thanks! --- Project ID: 07fcde41-284c-48e1-83d0-a92b28b116fc Full error:
#10 18.45 gyp ERR! find Python Python is not set from environment variable PYTHON

#10 18.45 gyp ERR! find Python checking if "python3" can be used

#10 18.45 gyp ERR! find Python - "python3" is not in PATH or produced an error

#10 18.45 gyp ERR! find Python checking if "python" can be used

#10 18.45 gyp ERR! find Python - "python" is not in PATH or produced an error

#10 18.45 gyp ERR! find Python

#10 18.45 gyp ERR! find Python
#10 18.45 gyp ERR! find Python Python is not set from environment variable PYTHON

#10 18.45 gyp ERR! find Python checking if "python3" can be used

#10 18.45 gyp ERR! find Python - "python3" is not in PATH or produced an error

#10 18.45 gyp ERR! find Python checking if "python" can be used

#10 18.45 gyp ERR! find Python - "python" is not in PATH or produced an error

#10 18.45 gyp ERR! find Python

#10 18.45 gyp ERR! find Python
Solution:
FIXED by removing 2 dependencies that were depneding on old versions of node-gyp (incompatible with Node 18) Didn't end up needing the nixpacks.toml Thanks a ton @Brody for pointing me in the right direction, though! Appreciated 🚀...
Jump to solution
16 Replies
Percy
Percy•14mo ago
Project ID: 07fcde41-284c-48e1-83d0-a92b28b116fc
Brody
Brody•14mo ago
python was never a part of a javascript deployment before
lukasgjetting
lukasgjetting•14mo ago
Just tried to redeploy that latest succeeding deployment - which also failed. So doesn't seem like it's a new dependency on my side Oh, that's odd then
Brody
Brody•14mo ago
very, but yeah it can be added, add this to a nixpacks.toml file in your project
[phases.setup]
nixPkgs = ['...', 'python38', 'gcc']
[phases.setup]
nixPkgs = ['...', 'python38', 'gcc']
lukasgjetting
lukasgjetting•14mo ago
Thanks! Sorry if this is a dumb question, but should I include the '...' part? Currently have no nixpacks.toml file
Brody
Brody•14mo ago
yes you should
lukasgjetting
lukasgjetting•14mo ago
Awesome thanks - will report back with result
Brody
Brody•14mo ago
its an array extension, if you left it out python38 would then be the only thing added during build, but we want to add python on to the packages that are added by default, like node, and yarn
lukasgjetting
lukasgjetting•14mo ago
Getting a new error now... seems like it's now missing g++?
#10 24.26 gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

#10 24.26 make: Entering directory '/app/node_modules/deasync/build'

#10 24.26 CXX(target) Release/obj.target/deasync/src/deasync.o

#10 24.26 make: g++: No such file or directory

#10 24.26 make: *** [deasync.target.mk:107: Release/obj.target/deasync/src/deasync.o] Error 127

#10 24.26 make: Leaving directory '/app/node_modules/deasync/build'

#10 24.26 gyp ERR! build error

#10 24.26 gyp ERR! stack Error: `make` failed with exit code: 2

#10 24.26 gyp ERR! stack at ChildProcess.onExit (/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)

#10 24.26 gyp ERR! stack at ChildProcess.emit (node:events:514:28)

#10 24.26 gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)

#10 24.26 gyp ERR! System Linux 5.10.0-25-cloud-amd64

#10 24.26 gyp ERR! command "/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/bin/node" "/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

#10 24.26 gyp ERR! cwd /app/node_modules/deasync

#10 24.26 gyp ERR! node -v v18.17.1

#10 24.26 gyp ERR! node-gyp -v v9.3.1

#10 24.26 gyp ERR! not ok

#10 24.26 Build failed

#10 24.26 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this
#10 24.26 gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

#10 24.26 make: Entering directory '/app/node_modules/deasync/build'

#10 24.26 CXX(target) Release/obj.target/deasync/src/deasync.o

#10 24.26 make: g++: No such file or directory

#10 24.26 make: *** [deasync.target.mk:107: Release/obj.target/deasync/src/deasync.o] Error 127

#10 24.26 make: Leaving directory '/app/node_modules/deasync/build'

#10 24.26 gyp ERR! build error

#10 24.26 gyp ERR! stack Error: `make` failed with exit code: 2

#10 24.26 gyp ERR! stack at ChildProcess.onExit (/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)

#10 24.26 gyp ERR! stack at ChildProcess.emit (node:events:514:28)

#10 24.26 gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)

#10 24.26 gyp ERR! System Linux 5.10.0-25-cloud-amd64

#10 24.26 gyp ERR! command "/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/bin/node" "/nix/store/fg86njc0q2djbyfaqvnaq7x0khpc6sf4-nodejs-18.17.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

#10 24.26 gyp ERR! cwd /app/node_modules/deasync

#10 24.26 gyp ERR! node -v v18.17.1

#10 24.26 gyp ERR! node-gyp -v v9.3.1

#10 24.26 gyp ERR! not ok

#10 24.26 Build failed

#10 24.26 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this
Brody
Brody•14mo ago
updated
lukasgjetting
lukasgjetting•14mo ago
Thanks - still failing though... Ahhh I see! Node was updated from 16_x to 18_x Node 16 is EOL, so it makes sense Which might trigger node-gyp to do a fresh build Is there a place where I can see all the nixpack aliases for different packages? Or does it match apt-get or similar repo?
lukasgjetting
lukasgjetting•14mo ago
Perfect, thanks Brody! Will update this thread when I find a solution
Solution
lukasgjetting
lukasgjetting•14mo ago
FIXED by removing 2 dependencies that were depneding on old versions of node-gyp (incompatible with Node 18) Didn't end up needing the nixpacks.toml Thanks a ton @Brody for pointing me in the right direction, though! Appreciated 🚀
Brody
Brody•14mo ago
awsome glad you where able to solve it! and you even came to the appropriate solution, mixing languages is not the best option
Want results from more Discord servers?
Add your server