betatim / notebook-as-pdf

Save Jupyter Notebooks as PDF
BSD 3-Clause "New" or "Revised" License
368 stars 72 forks source link

nbconvert failed: module 'asyncio' has no attribute 'run' #20

Closed jojogh closed 3 years ago

jojogh commented 3 years ago

hi, I am current use python 3.6, and I have installed notebook-as-pdf, when I create pdf and download it from menu, meet the error nbconvert failed: module 'asyncio' has no attribute 'run', the error detailed info is below: [I 2020-09-25 10:56:00.901 SingleUserNotebookApp log:158] 101 GET /research/user/18621009317/api/kernels/e05d5cb2-25ee-4ac5-9b5e-5d13e2b7f561/channels?session_id=aed108f1902345d78d12bd5f616ba207 (18621009317@58.247.201.152) 577.30ms [E 2020-09-25 10:57:17.935 SingleUserNotebookApp handlers:133] nbconvert failed: module 'asyncio' has no attribute 'run' Traceback (most recent call last): File "/root/anaconda3/lib/python3.6/site-packages/notebook/nbconvert/handlers.py", line 130, in get resources=resource_dict File "/root/anaconda3/lib/python3.6/site-packages/notebook_as_pdf/init.py", line 166, in from_notebook_node asyncio.run, AttributeError: module 'asyncio' has no attribute 'run' [W 2020-09-25 10:57:17.936 SingleUserNotebookApp web:1667] 500 GET /research/user/18621009317/nbconvert/PDFviaHTML/1.0%E7%BB%84%E5%90%88%E5%91%A8%E6%9C%9F%E9%80%89%E8%82%A1.ipynb?download=true (58.247.201.152): nbconvert failed: module 'asyncio' has no attribute 'run'

how can I change something to make it compatible with python 3.6, currently, I don't want to update to python 3.7, as there are a lot of stuffs to update. thanks!

betatim commented 3 years ago

Making this compatible with an old version of Python is currently out of scope. If you find time to figure out what needs to be done and can implement it, we can consider making the changes.

tashrifbillah commented 2 years ago

Hi @betatim , just your comment helped me solved this issue. I upgraded to Python >= 3.7. Thank you very much.