Jetzt bin ich verwirrt:
Code: Alles auswählen
>>> import hashlib
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "hashlib.py", line 139, in <module>
File "hashlib.py", line 91, in __get_builtin_constructor
try:
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "hashlib.py", line 139, in <module>
File "hashlib.py", line 91, in __get_builtin_constructor
try:
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "hashlib.py", line 139, in <module>
File "hashlib.py", line 91, in __get_builtin_constructor
try:
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "hashlib.py", line 139, in <module>
File "hashlib.py", line 91, in __get_builtin_constructor
try:
ValueError: unsupported hash type sha512
>>> import hashlib
>>> import _sha256
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named _sha256
>>>
Nur beim ersten Versuch, hashlib zu importieren kommt eine Fehlermeldung. Das Gleiche gilt auch für pyPdf. Wenn man es zweimal importieren will klappt's.
_hashlib lässt sich nicht importieren (ImportError: No module named _hashlib)
Der Code von nomnom funktioniert leider auch nicht (AttributeError: 'module' object has no attribute 'sha256')
Meine aktuelle Aufgabe an pyPdf, ein PDF-Dokument zu drehen, funktioniert auch ohne hashlib, also wenn ich die Import-Anweisung auskommentiere.