1
votes

I tried to run Jupyter notebook from my Windows command prompt with this command:

python -m notebook

But I get the following error:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec)

File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)

File "C:\ProgramData\Anaconda3\lib\site-packages\notebook_main_.py", line 3, in
from notebook import notebookapp as app

File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 7, in
import asyncio

File "C:\ProgramData\Anaconda3\lib\asyncio_init_.py", line 26, in
from .queues import *

File "C:\ProgramData\Anaconda3\lib\asyncio\queues.py", line 12, in from .tasks import coroutine

File "C:\ProgramData\Anaconda3\lib\asyncio\tasks.py", line 329
fs = {async(f, loop=loop) for f in set(fs)}
^
SyntaxError: invalid syntax

I have no idea what to do next.

1
did you try starting the notebook using jupyter notebook.srishtigarg
This looks like older code is run on a newer Python version (async used as function name, it's a keyword now). Make sure your Jupyter is up to date!Klaus D.
As the other suggest, a jupyter notebook is not a python file. If you open the jupyter file in a text editor you will notice the difference. Save/export the python code from jupyter as .py file in the file/download menuStefan

1 Answers

0
votes

You don't need to use the CLI for this. Instead, you can just click on the Jupiter application where it's available on start menu/ All programs. After you open you'll see it's loading CLI and automatically opens using your default browser.