Getting `python: command not found` at build
Hi, build for project
852d436d-dbcc-4eba-986d-bd7e01a98613
keeps on failing:
Where should I look for clues?
Thank you38 Replies
Project ID:
852d436d-dbcc-4eba-986d-bd7e01a98613,c556cde8-b8e0-4934-9b2a-486aafb6dac8
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I don't
but I am indeed using Python in this project.
And I have both a
requirements.txt
and pyproject.toml
in the project's root.Hmm, this is pretty strange.
As a workaround, you could try setting
NIXPACKS_PKGS
(environment variable) to python311
It's weird 'cause I have another service that doesn't have any of that, and it works.
Also, it would be nice for the system to pick up the Python version from the
pyproject.toml
's requires-python
setting if present.
Can't really find a solution to this, hopefully someone can shed some light as to why this is happening.send me the link to your repo and ill have a look at it when i have some time
It's a private repo, gotta send you an invitation. Email address?
Sent, you should be able to join now.
okay ill have a look in a bit
is this supposed to be a monorepo?
@Niccolò
@Niccolò sounds like you didn’t do what aleks suggested here
that’s the solution
Some node packages require python to install them. Python isn’t automatically added as a provider in these cases
ive seen their repo, its a little more complicated than that unfortunately
eh if it wants python give it python
if there’s more errors once that is solved we can take those on. one step at a time
as far as i can tell its a monorepo but with a lot of things out of place
for example theres a package.json file at the root that pertains to a service thats 3 directories deep that doesnt have a package.json, it also lacks a start command, so lots of issues to work through with the first i think should be to get the directory structure setup properly
agreed
Nope, I did follow the suggestion, but I had more errors with Django not being found and, like I said, I have another project where everything works just fine without customizing the environment in any way.
The FE is not a service in that repo, technically.
FYI, the only different between the repo where Python is detected automatically and this one is the
package.json
in the root.
I will move it away from the root and see how it fares.
Yep, it's working.
I guess the environment got really confused by the package.json
in the root.Yeah, it looks like the Node provider is tested before the Python provider, so if it sees a
package.json
, it'll think it's a Node app.Frankly, I've often seen the
package.json
placed in the root folder in monorepos.
Imo the pipeline should check whether, among the possible files used to detect an environment, only the package.json
is present in the root.
So, it went through the part of the build where it was failing before, but then failed because my project needs Python3.11. I therefore added python311
to NIXPACKS_PKGS
but it fails again:
It's still installing Python 3.8 for some reasonBoth
NIXPACKS_PKGS=postgresql python311
and NIXPACKS_PKGS=postgresql,python311
do not workCreate a nixpacks.toml and manually set the packages you'd like to install
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image
env variables are a bandaid fix, this is more permanent
thanks
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Read the docs I sent above and you'll be able to make your own
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Please send the nixpacks.toml you made
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Add “…” as a provider and setup package. This allows nixpacks to add auto detected packages as well
also, pretty sure the provider is python3 not python
you shouldn’t have to set an install command. Nixpacks will auto detect it
And you’re overwriting the build command with nothing atm
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
alright fair enough
can you drop an ls before your start command?
Hey there, keeping an eye on everything here. Won't be able to get to this immediately but we are going to be working on a soltion for this.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
PRs welcome on our docs
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Sorry, I seldom log into this account. Did you manage in the end?
Anyway, this is all I needed in the end (
python311
is there to comply with specific requirements):
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View