Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'PDFTextExtractionNotAllowed' from 'pdfminer.pdfpage'. #169

Closed
Oleh-Hrebchuk opened this issue Jul 20, 2020 · 10 comments · Fixed by #171
Closed
Labels
bug Something isn't working

Comments

@Oleh-Hrebchuk
Copy link

import camelot
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/camelot/init.py", line 6, in
from .io import read_pdf
File "/usr/local/lib/python3.7/site-packages/camelot/io.py", line 5, in
from .handlers import PDFHandler
File "/usr/local/lib/python3.7/site-packages/camelot/handlers.py", line 9, in
from .parsers import Stream, Lattice
File "/usr/local/lib/python3.7/site-packages/camelot/parsers/init.py", line 3, in
from .stream import Stream
File "/usr/local/lib/python3.7/site-packages/camelot/parsers/stream.py", line 10, in
from .base import BaseParser
File "/usr/local/lib/python3.7/site-packages/camelot/parsers/base.py", line 5, in
from ..utils import get_page_layout, get_text_objects
File "/usr/local/lib/python3.7/site-packages/camelot/utils.py", line 17, in
from pdfminer.pdfpage import PDFTextExtractionNotAllowed
ImportError: cannot import name 'PDFTextExtractionNotAllowed' from 'pdfminer.pdfpage' (/usr/local/lib/python3.7/site-packages/pdfminer/pdfpage.py)

After build project I see this error.
Also, I see that package pdfminer.six-20200720 did release today.

@Oleh-Hrebchuk
Copy link
Author

pip install pdfminer.six==20200517 if install older version all works fine

@vinayak-mehta
Copy link
Member

I'll fix it right now and create a release.

@vinayak-mehta
Copy link
Member

@xamey I saw your PR. I'll fix it here.

@carsonyl
Copy link

@vinayak-mehta pdfminer.six released version 20200726 today, which reverts PDFTextExtractionNotAllowedError back to PDFTextExtractionNotAllowed. I had to install pdfminer.six 20200720 to get it working again with camelot 0.8.1.

@vinayak-mehta
Copy link
Member

vinayak-mehta commented Jul 27, 2020

Yes, I pointed out the breaking change on their gitter channel and a contributor reverted it. 😅 pdfminer/pdfminer.six#461

I'm releasing camelot 0.8.2 with the revert. #175

@vinayak-mehta
Copy link
Member

Maybe I should also yank 0.8.1 on PyPI.

@name-andy46
Copy link

Just installed this on conda, got the same error "cannot import PDFTextExtractionNotAllowed". I imported pdfminer.six and checked, it has PDFTextExtractionNotAllowedError. Realized that conda ditribution is till on 0.8.0.
So uninstalled from conda and installed with pip "camelot-py[cv]". This imports without error.

@aflip
Copy link

aflip commented Aug 13, 2020

@vinayak-mehta pdfminer.six released version 20200726 today, which reverts PDFTextExtractionNotAllowedError back to PDFTextExtractionNotAllowed. I had to install pdfminer.six 20200720 to get it working again with camelot 0.8.1.

This is what worked for me also.

@vinayak-mehta
Copy link
Member

Please install the latest v0.8.2 with pip install --upgrade camelot-py. This version for conda will be released soon. Right now, there's a blocker to do that: conda-forge/camelot-py-feedstock#20

@aflip
Copy link

aflip commented Aug 14, 2020

Please install the latest v0.8.2 with pip install --upgrade camelot-py. This version for conda will be released soon. Right now, there's a blocker to do that: conda-forge/camelot-py-feedstock#20

This worked.

Had to also run

pip install --upgrade pdfminer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants