Skip to content

to_image causes 'map' object is not subscriptable in Image.py, line 1203 #637

Answered by jsvine
tye-shutty asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tye-shutty, and thanks for posting. Looking at the traceback, and investigating further, this seems to have something to do with newer versions of PIL/pillow. As defined in its requirements.txt, pdfplumber requires Pillow>=8.4. The code works fine for me with 8.4 (and 9.0) but falis (with the same error) when I upgrade to the latest version, 9.1, released just 10 days ago. (Specifically, it appears to stem from the addition of these lines checking for negative crops.)

If you'd like to check for your particular case, can you add this line to your script and rerun on your two machines:

import PIL
print(PIL.__version__)

If that's indeed the case for you, the immediate fix would be to run p…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tye-shutty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants