Belval / pdf2image

A python module that wraps the pdftoppm utility to convert PDF to PIL Image object
MIT License
1.63k stars 196 forks source link

TypeError: ThreadSafeGenerator object is not an iterator #133

Closed gamesun closed 4 years ago

gamesun commented 4 years ago

Describe the bug Traceback (most recent call last): File "p.py", line 9, in images = convert_from_path("p.pdf") File "/home/***/.local/lib/python2.7/site-packages/pdf2image/pdf2image.py", line 143, in convert_from_path thread_output_file = next(output_file) TypeError: ThreadSafeGenerator object is not an iterator

To Reproduce

Desktop (please complete the following information):

Additional context This is found by RokiDGupta at https://stackoverflow.com/questions/60701262/convert-pdf-to-image-using-python Maybe this will be helpful https://github.com/lalonderodney/SegCaps/issues/14

gamesun commented 4 years ago

I miss the readme said a python (3.5+) module. I think if fix the next() issue, pdf2image will be able to run in py2.

Belval commented 4 years ago

Hi,

With Python 2.7 being officially unsupported, I have stopped any effort to maintain compatibility.

Version 1.7.1 should work on python 2.7. You can get it with pip install pdf2image==1.7.1.

gamesun commented 4 years ago

OK, thanks