jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.48k stars 658 forks source link

Issue with importing pdfplumber library #1033

Closed FatemaD1577 closed 11 months ago

FatemaD1577 commented 11 months ago

Describe the bug

I have installed the pdfplumber library from https://pypi.org/project/pdfplumber/. The installation is done successfully. But when I try to import the library it gives me error.

Have you tried repairing the PDF?

Please try running your code with pdfplumber.open(..., repair=True) before submitting a bug report.

Code to reproduce the problem

Paste it here, or attach a Python file.

PDF file

Please attach any PDFs necessary to reproduce the problem.

If you need to redact text in a sensitive PDF, you can run it through JoshData/pdf-redactor.

Expected behavior

What did you expect the result should have been?

Actual behavior

What actually happened, instead?

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Additional context

Add any other context/notes about the problem here.

I am getting error while importing the library as follows: ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp'

jsvine commented 11 months ago

Hi @FatemaD1577; it appears you have an old version of pdfminer or pdfminer.six installed. This should fix it for you:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber
FatemaD1577 commented 11 months ago

Hi @jsvine . Thanks for the reply. I tried the steps but still facing the same issue.

yifan-chen-2020 commented 11 months ago

Hi @FatemaD1577; it appears you have an old version of pdfminer or pdfminer.six installed. This should fix it for you:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber

The solution above solves the following error:

ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp' (/home/tiger/.local/lib/python3.9/site-packages/pdfminer/pdfinterp.py)

FatemaD1577 commented 11 months ago

Hi @FatemaD1577; it appears you have an old version of pdfminer or pdfminer.six installed. This should fix it for you:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber

The solution above solves the following error:

ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp' (/home/tiger/.local/lib/python3.9/site-packages/pdfminer/pdfinterp.py)

Didn't solve the issue at my end.

image

gengdata commented 7 months ago

Hi @FatemaD1577; it appears you have an old version of pdfminer or pdfminer.six installed. This should fix it for you:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber

The solution above solves the following error: ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp' (/home/tiger/.local/lib/python3.9/site-packages/pdfminer/pdfinterp.py)

Didn't solve the issue at my end.

image

Restart the jupyternootbook page

Jefronty commented 4 months ago

Hi @FatemaD1577; it appears you have an old version of pdfminer or pdfminer.six installed. This should fix it for you:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber

The solution above solves the following error: ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp' (/home/tiger/.local/lib/python3.9/site-packages/pdfminer/pdfinterp.py)

Didn't solve the issue at my end. image

Restart the jupyternootbook page

I also tried the suggested steps and it did not fix the issue. I am using Python 3.9.2 on Debian 11 (Bullseye)

optivisionlab commented 2 days ago

CHÀO@FatemaD1577pdfminer; có vẻ như bạn đã cài đặt phiên bản cũ pdfminer.six. Điều này sẽ khắc phục được lỗi cho bạn:

pip uninstall pdfminer
pip uninstall pdfminer.six
pip install -U pdfplumber

Giải pháp trên giải quyết được lỗi sau:

ImportError: cannot import name 'PDFStackT' from 'pdfminer.pdfinterp' (/home/tiger/.local/lib/python3.9/site-packages/pdfminer/pdfinterp.py)

It's worked