0

I'm using PyMuPDF in a Flask application and also in some standalone scripts. I'm trying to update my requirements.txt to include the proper PyMuPDF package I'm using but using the Context Action in Pycharm, the Sync requirements.txt option in the Tools menu, and running pipreq do not update my requirements.txt at all. (Fitz is the package to import for PyMuPDF)

enter image description here

I can manually add it, but it doesn't do away with the warning on in Pycharm, and there's also an option in Pycharm to remove any unused requirements. I don't want someone to accidentally do that. I don't think this is a Pycharm or pipreq problem, but something with PyMuPDF.

What needs to be updated in PyMuPDF's code to handle this properly? Or is there anything I can do to support it in my code?

DFW
  • 805
  • 1
  • 8
  • 18

1 Answers1

0

PyMuPDF does not have any requirements (i.e. it does not depend on any other Python packages), so i'm not sure why you think there is a problem in PyMuPDF here.

Presumably something or someone has decided to install PyMuPDF on your system. In which case it is surely up to this "something" to add pymupdf=1.22.5 (for example) to a requirements.txt file? PyMuPDF itself cannot know why it was installed.

Julian Smith
  • 196
  • 1
  • 2
  • If my application requires PyMuPDF to function, would that not be a reason to have it in my requirements file? Or are you saying that if I attempt to use PyMuPDF without adding it, then it will work automatically? I think the former is accurate, plus it tells developers which version to download. But nothing is added when the requirements are generated by IntelliJ or pipreq – DFW Jul 03 '23 at 02:36
  • Yes, PyMuPDF should probably be in your requirements file. But i do not think that it is the responsibility of PyMuPDF to do this - PyMuPDF cannot know how or why it was installed onto your system. What caused PyMuPDF to be installed on your system? – Julian Smith Jul 03 '23 at 13:39