-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PyCryptodome is required for some PDFs, but is not installed automatically as a dependency #1525
Comments
If you want it, you need to install the extra as documented https://pypdf.readthedocs.io/en/latest/user/encryption-decryption.html |
Thanks, it looks like the link to the installation guide at the top of that page is broken; however, I was able to get to the installation guide using the link in the table of contents on the left. I tried running
Maybe it's because I'm using zsh instead of bash? In any case, I was able to install pypdf[full] by adding quote marks: |
Yes, that is a zsh issue. You need to escape the brackets Thanks for pointing out that the link is broken, I'll fix that tomorrow |
The doc for https://pypdf.readthedocs.io/en/latest/user/installation.md is down, shows 404, who can help me with this? |
Where did you get that URL from? |
@MartinThoma the links has been broken on https://pypdf.readthedocs.io. There was a PR to fix that #1537. Can you re-deploy the docs? |
I have no clue what you mean @abyesilyurt . When I go on the page, the links are not broken. Also, this has nothing to do with the PyCryptodome issue, right? It would help me and others if you opened another issue instead of writing it into a random issue |
aaah, now I get it 💡 #1537 was undone because it broke the build process completely |
Let me open another issue for this :-) |
I am not writing this into a random issue, @mogocat mentioned above that he cannot access the links. |
Just install |
There is nothing wrong on the pypdf side here - we support running without any cryptography library and without Pillow installed. If you need support for one of them, you should use the provided extras: Lines 42 to 51 in f1b471b
|
When pycryptodome is not installed, pypdf fails to read some PDFs, and gives this error:
Because I wasn't familiar with pycryptodome, I wasn't sure what I needed to do to get it working. Eventually I figured out that pycryptodome was a Python library, and all I had to do was run
pip3 install pycryptodome
to fix the error.If possible, it would be nice if pypdf could 1) install pycryptodome as a dependency as part of the installation process for pypdf, OR 2) provide more information in the error, letting the user know that pycryptodome is a Python library than can be installed via pip.
Environment
Which environment were you using when you encountered the problem?
$ python3 -m platform macOS-13.1-arm64-arm-64bit $ python3 -c "import pypdf;print(pypdf.__version__)" 3.1.0
Code + PDF
This is a minimal, complete example that shows the issue:
pip3 install pypdf
).pip3 uninstall pycryptodome
).This is the PDF I'm attempting to read: https://web.archive.org/web/30000101000000if_/http://www.latterdaytruth.org/pdf/100846.pdf
Traceback
The text was updated successfully, but these errors were encountered: