0

I need to get text and svgs incorporated in pdf in python. I tried PyDF2, PyPDF4, tika did not work. I tried using pymupdf but getting below error. Can some help me with it. I am using python 3.8, pycharm. All modules required for pymupdf are already there.

Error :

Traceback (most recent call last):
  File "path/PDFImage.py", line 2, in <module>
    doc = fitz.open("./Docs/pdffile.pdf")
AttributeError: module 'fitz' has no attribute 'open'
blondelg
  • 916
  • 1
  • 8
  • 25
Rohit T
  • 1
  • 1
  • Does anything from here help?: https://github.com/pymupdf/PyMuPDF/issues/660 – jjramsey Jun 03 '21 at 14:28
  • I checked that but could not understand. What does "this error usually indicates that __init__.py wasn't executed. Which e.g. happens when you are in the installation fitz directory and start python." mean. – Rohit T Jun 03 '21 at 14:58
  • What's after the "e.g." is just an example of why a file with the path `fitz/__init__.py` wasn't executed. The particular example might not apply to you. What might apply is this [comment](https://github.com/pymupdf/PyMuPDF/issues/660#issuecomment-694845403), where it's revealed that the error came from a broken installation of PyMuPDF. – jjramsey Jun 03 '21 at 16:03
  • I did the re installation as well but that too did not fix the problem. Do anyone know the stable version of pymupdf that i can install. – Rohit T Jun 04 '21 at 03:35
  • For the latest stable version, go to pypi.org and search for "PyMuPDF" (without the quotes). That said, it would help a *lot* if you described the steps that you used to install PyMuPDF. – jjramsey Jun 04 '21 at 12:07

0 Answers0