Hi i am trying to import multiple different elements from the pdfminer package
When i write:
‘’‘from pdfminer.pdfpage import PDFPage’’’
i get the following error message:
“ImportError: cannot import name ‘Rect’ from ‘pdfminer.utils’ (/usr/local/lib/python3.7/site-packages/pdfminer/utils.py)”
When i run the same code on my own computer, that has the same version of pdfminer.six installed as anvil, i don’t get an error message. After opening the “pdfminer.pdfpage” module on my own computer, i found the import statement causing the error in anvil. After forcefully removing the import statement (with the modify_and_import method user “Martin Valgur” posted on this stackoverflow post: python - How to modify imported source code on-the-fly? - Stack Overflow), this error message is shown:
“ImportError: cannot import name ‘Rect’ from ‘pdfminer.utils’ (/usr/local/lib/python3.7/site-packages/pdfminer/utils.py)”
Another weird thing i have noticed is that the import statement:
‘’‘from pdfminer.pdfparser import PDFPage’’’
imports a class. When running the same import statement locally it raises an error as this class does not exist in my local pdfminer.pdfparser module. I have not been able to find any documentation for the class either(even though that does not say much since pdfminer.six documentation is sparse). The class does not have the same functionality as the PDFPage class that should be in pdfminer.pdfpages.
I find this very strange, as i installed the version of pdfminer.six that the anvil docs link to. I also uninstalled pdfminer.six prior to the installation, to ensure that i have the same version as anvil.
I would seriously appreciate any time spent looking into this issue.