jupyter / jupyter_console

Jupyter Terminal Console
http://jupyter-console.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
247 stars 146 forks source link

Jupyter console invalid syntax with Python 3.10 #259

Closed larsks closed 2 years ago

larsks commented 2 years ago

The console code uses deprecated asyncio features. Under python 3.10, attempting to run jupter console fails with:

Traceback (most recent call last):
  File "/home/user/.local/bin/jupyter-console", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.10/site-packages/jupyter_core/application.py", line 264, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/home/user/.local/lib/python3.10/site-packages/jupyter_console/app.py", line 148, in start
    self.shell.mainloop()
  File "/home/user/.local/lib/python3.10/site-packages/jupyter_console/ptshell.py", line 676, in mainloop
    main_task = asyncio.wait(tasks, loop=loop, return_when=asyncio.FIRST_COMPLETED)
TypeError: wait() got an unexpected keyword argument 'loop'
sys:1: RuntimeWarning: coroutine 'ZMQTerminalInteractiveShell.interact' was never awaited
Tiko7454 commented 2 years ago

open /home/user/.local/lib/python3.10/site-packages/jupyter_console/ptshell.py file and remove loop=loop in main_task = asyncio.wait(tasks, loop=loop, return_when=asyncio.FIRST_COMPLETED)

davidbrochart commented 2 years ago

Fixed in #264.