gpt4 book ai didi

python - matplotlib pdf savefig 提前退出

转载 作者:太空宇宙 更新时间:2023-11-04 01:19:55 25 4
gpt4 key购买 nike

所以我复制了给定的示例 here当我运行它时,我得到:

Traceback (most recent call last):
File "C:\Users\User\Documents\Project work\pdf.py", line 9, in <module>
with PdfPages('multipage_pdf.pdf') as pdf:
AttributeError: __exit__

那么我该从这里去哪里呢?谢谢

最佳答案

PdfPages 仅在 1.3.1 版本中成为上下文管理器。查看chagelog .

特别注意以下行:

Added a context manager for creating multi-page pdfs (see matplotlib.backends.backend_pdf.PdfPages).

关于python - matplotlib pdf savefig 提前退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21933904/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com