2 years ago
I attempted to build an api using nixpacks with the requirements.txt file outside of the root directory (e.g. src/requirements.txt). When doing this all builds failed with varying build commands.
What's the explanation for this behavior? Is there a way successfully build with requirements.txt outside of the root directory?
Thanks in advance!
10 Replies
2 years ago
is the rest of your project located in the src directory?
2 years ago
I would say you need to restructure your project
I was able to build the project but am curious what the explanation is behind this behavior and if it's possible to work with a different project structure
2 years ago
requirements.txt being inside of src/ is pretty irregular for python projects. It's expected to be inside the root folder
2 years ago
If you'd like any advice on your app's folder structure, I'd be happy to help out. Just send your GH repo or a screenshot of your folder structure in your IDE
i have same problem here
i create this file
nixpacks.toml
[variables]
BPREQUIREMENTSTXT_PATH = "requirements/production.txt"
[phases.setup]
nixPkgs = ["python312"]
[phases.install]
cmd = ["pip install -r requirements/production.txt"]
[start]
cmd = "./entrypoint.sh"
but it wont recognize my requirement/production.txt and when i see the plan it is always going for default requiements.txt in root. how to tell it to change the requirement.txt location on build