13

On importing pdfminer.high_level, I am getting an error cannot import name open_filename from pdfminer.utils.

I tried following steps:

  1. pip3 install pdfminer.six
  2. import pdfminer
  3. import pdfminer.high_level

(and encountered error on this line)


ImportError                               Traceback (most recent call last)
<ipython-input-6-772e4980255d> in <module>
----> 1 import pdfminer.high_level

~\anaconda3\lib\site-packages\pdfminer\high_level.py in <module>
     12 from .pdfinterp import PDFResourceManager, PDFPageInterpreter
     13 from .pdfpage import PDFPage
---> 14 from .utils import open_filename
     15 
     16 

ImportError: cannot import name 'open_filename' from 'pdfminer.utils'
D_00
  • 1,440
  • 2
  • 13
  • 32
Neha Narang
  • 131
  • 1
  • 3
  • I also faced this issue (python `3.9` and `3.6`), what I did was to install `pdfminer.six` with python `3.8` and it worked – amonowy Apr 22 '21 at 11:16

1 Answers1

12

Hi I had the same issue.

I had installed both pdfminer and pdfminer.six. Please keep pdfminer.six and uninstall pdfminer with:

pip uninstall pdfminer
Edwin Abraham
  • 645
  • 7
  • 24