No module named fitz

I'm deploying a Python Flask app that uses the python library PyMuPDF to handle PDFs. One of the modules that PyMuPDF needs is fitz. Requires a simple pip install for both of these. I believe it isn't on the default python available in Railway. How can this be added?
8 Replies
Percy
Percy2y ago
Project ID: N/A
csd4ni3l
csd4ni3l2y ago
just make a requirements.txt file and add it there
CierrePorbin
CierrePorbin2y ago
N/A I have the PyMuPDF in my requirements.txt already. You mean I should add fitz too?
csd4ni3l
csd4ni3l2y ago
yes if its on pip then you just add it there and it installs it
CierrePorbin
CierrePorbin2y ago
ok will do and will share result here. Thanks! here's my requirements file: Flask==2.3.2 langchain==0.0.170 openai==0.27.6 pandas==1.5.3 pinecone_client==2.2.1 PyMuPDF==1.22.3 Werkzeug==2.3.4 fitz==0.0.1 I still get the same error...
csd4ni3l
csd4ni3l2y ago
did you remove the old deployment and did railway up right? if so then its pretty weird
CierrePorbin
CierrePorbin2y ago
yes, I did. it is weird I'm looking if there isn't a way for me to change my code. Because accessing the fitz library in my project directly triggers a bunch of different dependencies. I think it's anyway adding inefficiencies in my code no wthat I see this
Adam
Adam2y ago
Is fitz successfully installing? Can you run a command before your start command to check the version? Maybe just pip freeze?
Want results from more Discord servers?
Add your server