我使用 nbconvert 使用以下代码将笔记本转换为 pdf:
(base) C:\Users\25470\Desktop\Data Projects\Quantium Virtual Internship\Assingment 2>jupyter nbconvert task2.ipynb --to webpdf
我得到以下输出:
[NbConvertApp] Converting notebook task2.ipynb to webpdf
[NbConvertApp] Building PDF
那么这个错误:
Traceback (most recent call last):
File "d:\Anaconda3\Scripts\jupyter-nbconvert-script.py", line 10, in <module>
sys.exit(main())
File "d:\Anaconda3\lib\site-packages\jupyter_core\application.py", line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "d:\Anaconda3\lib\site-packages\traitlets\config\application.py", line 845, in launch_instance
app.start()
File "d:\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 350, in start
self.convert_notebooks()
File "d:\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 524, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "d:\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 489, in convert_single_notebook
output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
File "d:\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 418, in export_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 181, in from_filename
return self.from_file(f, resources=resources, **kw)
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 199, in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\webpdf.py", line 93, in from_notebook_node
pdf_data = self.run_pyppeteer(html)
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\webpdf.py", line 83, in run_pyppeteer
pdf_data = pool.submit(run_coroutine, main()).result()
File "d:\Anaconda3\lib\concurrent\futures\_base.py", line 439, in result
return self.__get_result()
File "d:\Anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result
raise self._exception
File "d:\Anaconda3\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\webpdf.py", line 82, in run_coroutine
return loop.run_until_complete(coro)
File "d:\Anaconda3\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "d:\Anaconda3\lib\site-packages\nbconvert\exporters\webpdf.py", line 49, in main
await page.goto('data:text/html,'+html, waitUntil='networkidle0')
File "d:\Anaconda3\lib\site-packages\pyppeteer\page.py", line 885, in goto
raise error
pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded.
这是什么意思 ?其他文件转换正常。Myb文件大小是问题,文件是2.5mb。