django python3.8无法从cryptography.hazmat.primitives.asymmetric导入ed448

dldeef67  于 2023-08-08  发布在  Go
关注(0)|答案(1)|浏览(201)

我正在使用python3.8运行一个Django项目,我试图从xhtml 2 pdf导入比萨,得到了下面列出的错误信息:

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xhtml2pdf/pisa.py", line 26, in <module>
    from xhtml2pdf.document import pisaDocument
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xhtml2pdf/document.py", line 24, in <module>
    from xhtml2pdf.builders.signs import PDFSignature
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xhtml2pdf/builders/signs.py", line 5, in <module>
    from pyhanko.pdf_utils.incremental_writer import IncrementalPdfFileWriter
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko/pdf_utils/incremental_writer.py", line 8, in <module>
    from . import generic, misc
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko/pdf_utils/generic.py", line 21, in <module>
    from .misc import (
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko/pdf_utils/misc.py", line 18, in <module>
    from pyhanko_certvalidator.util import CancelableAsyncIterator, ConsList
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/__init__.py", line 8, in <module>
    from .context import ValidationContext
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/context.py", line 13, in <module>
    from .fetchers.requests_fetchers import RequestsFetcherBackend
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/fetchers/requests_fetchers/__init__.py", line 8, in <module>
    from .cert_fetch_client import RequestsCertificateFetcher
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/fetchers/requests_fetchers/cert_fetch_client.py", line 7, in <module>
    from ...errors import CertificateFetchError
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/errors.py", line 8, in <module>
    from pyhanko_certvalidator._state import ValProcState
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/_state.py", line 5, in <module>
    from pyhanko_certvalidator.path import ValidationPath
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/path.py", line 15, in <module>
    from .util import get_ac_extension_value, get_issuer_dn
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pyhanko_certvalidator/util.py", line 10, in <module>
    from cryptography.hazmat.primitives.asymmetric import (
ImportError: cannot import name 'ed448' from 'cryptography.hazmat.primitives.asymmetric' (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py)

字符串
P.S.我的python版本是3.8.9,Django版本是2.0.7,密码学版本是2.2.2。你能帮我想想吗?谢谢!

j5fpnvbx

j5fpnvbx1#

Ed448支持仅在cryptography 2.6中可用,它在documentation和更新日志中提到。

相关问题