Problem installing dlib library in my railway environment
Project ID: 841bbdef-4033-4e74-953c-030beb316802
Project code: https://github.com/SeifShaat/Divine-Smile/tree/main
I'm trying to install dlib in my railway environment because it's needed in my python script. dlib requires CMake to be installed first so I wrote CMake, dlib, numpy and opencv-python in a requirements.txt file and committed it but for some reason dlib doesnt install because it keeps saying that CMake has to be installed. Can anyone please help?
Relevant log:
#11 11.86 × Running setup.py install for dlib did not run successfully.
#11 11.86 │ exit code: 1
#11 11.86 ╰─> [8 lines of output]
#11 11.86 running install
#11 11.86 running build
#11 11.86 running build_py
#11 11.86 package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
#11 11.86 running build_ext
#11 11.86
#11 11.86 ERROR: CMake must be installed to build dlib
#11 11.86
#11 11.86 [end of output]
GitHub
GitHub - SeifShaat/Divine-Smile
Contribute to SeifShaat/Divine-Smile development by creating an account on GitHub.
37 Replies
Project ID:
841bbdef-4033-4e74-953c-030beb316802
can i ask why you had a railway.yaml file?
I've tried a couple of things using chatgpt and railway.yaml was one of his answers
i thought so
full build logs please
in .txt format if you could
sure 1 sec
I just started using railway today for the first time, so it's a bit hard for me to grasp
this is untested, but try adding that as a
nixpacks.toml
file in your projectokay I'll try, 1 sec
returned a new error, want me to send over the full logs?
yes please
try this
sure 1 sec
still getting errors
@Brody still there?
I'm making dinner actually, but if you give me some minimal reproducible code I will give it another crack later tonight
sorry, what exactly do you mean by minimal reproducible code?
whenever you're free, you can check out my repository, it includes my code 'main.py' and the other 2 files referenced in the 'main.py' and the requirements.txt file which is the file that has the main problem I think. 'mainpy' is a 63 line code basically a minimal code and its fully commented in each line to clarify what exactly it's supposed to do. keep in mind that the problem im facing isnt in the main code for now but rather in the imported libraries that's used in the code (1 library to be exact 'dlib'). would that be okay?
please read over this, your repo is not what this guide would call minimal.
there's not much else I can do at this point without a minimal example to do tests with
The problem isn't in the code. the problem is that railway doesn't execute the pip command to install the requirements.txt successfully. the code itself is irrelevant to the problem except for the part where I import those packages, everything else in the code doesn't come into play when trying to solve this error. Basically the problem is in the requirements.txt once that problem is fixed it's done.
would you like me to send over the requirements.txt file?
i know your code is irrelevant, I'm just asking for you to make this just a tad easier for me, because as it stands, I'd have to download a repo with a 100mb file in it
if you could provide me with a repo, that excludes this file, that would be great
I wanna make things easier for you. And thank you by the way for helping me so far I really appreciate it.
I'm a bit new to programming. I'm currently a student so this is a bit hard for me.
so I'd just like a repo with the minimal amount of files/code that still produces the same build error as your full repo
Okay 1 sec I'll give it a try
okay but I'm only able to chat because I'm on my phone right now, I won't be able to do any tests until later tonight, so that gives you plenty of time
https://github.com/SeifShaat/Divine-Smile/tree/main
check this repo. it doesnt have any big files just the main code and the requirements.txt and the nixpacks.toml file you told me to create. would that be okay?
GitHub
GitHub - SeifShaat/Divine-Smile
Contribute to SeifShaat/Divine-Smile development by creating an account on GitHub.
yep that's what I'm talking about, thank you
I will get back to this later!
Okay, take your time.
Thanks in advance
@SShaat - turns out it wasn't too complicated after all.
1. delete the
nixpacks.toml
file
2. replace your requirements.txt
with this
3. add a .python-version
with this in it
4. add a Procfile
with this in it
5. make sure you don't have a build or start command defined in the railway service settings
with these changes, that minimal repo does buildsorry is the .python-version a file named like that?
that's correct, that's the name of the file
okay I'll try
Thank you so much. It worked. I pushed my original files back and it deployed and working. Thanks again
mind if I ask here if I run into any problem?
awesome, glad I could help!
of course, as long as the questions relate to railway in some way
yea ofc. Thanks again.
hey @Brody, I started using railway because I wanted to push a flask python script to host it on railway to be able to use it in my flutter app. The python script uses opencv and dlib to process facial features specifically to measure the distance between both eyebrows and the nose tip. I set up a camera system in my flutter app but have trouble sending the frames captured by the flutter camera to the python script to be processed and back to flutter to display. Can you help me with that? Thanks in advance
I might be able to, what seems to be the problem