Can't run jupyter notebook

I can’t seem to start jupyter notebook from Mac terminal. I am

using IJulia
jupyterlab()

or

using IJulia
jupyter notebook()

When the browswer opnes and I select Julia for the kernel, I get this (I am pasting part of the error) error:

> .julia/conda/3/lib/python3.7/site-packages/tornado/web.py", 
> line 1703, in _execute result = await result
> .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
> line 742, in run yielded = self.gen.throw(*exc_info)  # type: ignore
> .julia/conda/3/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 72, in post
>     type=mtype))
> .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
> line 735, in run value = future.result()
>   File "/Users/alieftekhari/.julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", line 742, in run
>     yielded = self.gen.throw(*exc_info)  # type: ignore
> .julia/conda/3/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", line 88, in create_session
>     kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
>  .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
>  line 735, in run value = future.result()
>  julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
>  line 742, in run yielded = self.gen.throw(*exc_info)  # type: ignore

I can successfully run jupyter with python kernel

Can you paste the rest of the error?

Here is the full error:

.julia/conda/3/lib/python3.7/site-packages/tornado/web.py", 
line 1703, in _execute result = await result
.julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
line 742, in run yielded = self.gen.throw(*exc_info)  # type: ignore
.julia/conda/3/lib/python3.7/site-packages/notebook/services/sessions/handlers.py", line 72, in post
    type=mtype))
.julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
line 735, in run value = future.result()
  File "/Users/alieftekhari/.julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
  line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
.julia/conda/3/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", 
line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
 .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
 line 735, in run value = future.result()
 julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", 
 line 742, in run yielded = self.gen.throw(*exc_info)  # type: ignore
.julia/conda/3/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py", 
line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
 .julia/conda/3/lib/python3.7/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
.julia/conda/3/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", 
line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  .julia/conda/3/lib/python3.7/site-packages/jupyter_client/multikernelmanager.py", 
  line 158, in start_kernel
    km.start_kernel(**kwargs)
 .julia/conda/3/lib/python3.7/site-packages/jupyter_client/manager.py", 
 line 305, in start_kernel
    self.kernel = self._launch_kernel(kernel_cmd, **kw)
.julia/conda/3/lib/python3.7/site-packages/jupyter_client/manager.py", 
line 212, in _launch_kernel
    return launch_kernel(kernel_cmd, **kw)
  .julia/conda/3/lib/python3.7/site-packages/jupyter_client/launcher.py", 
  line 135, in launch_kernel
    proc = Popen(cmd, **kwargs)
.julia/conda/3/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
.julia/conda/3/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 
'/Applications/JuliaPro-1.4.1-1.app/Contents/Resources/julia/Contents/Resources/julia/bin/julia': 
'/Applications/JuliaPro-1.4.1-1.app/Contents/Resources/julia/Contents/Resources/julia/bin/julia'

This seems to be the relevant line:

I’m guessing that you renamed or moved your Julia installation so that this path no longer works. Just re-run build IJulia at the package prompt in the Julia command line.

1 Like

Sorry, I am just starting and not familiar with all the syntax; here is what I did but I got error:

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.1 (2020-04-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |


julia> build IJulia
ERROR: syntax: extra token "IJulia" after end of expression
Stacktrace:
 [1] top-level scope at none:0

First type ] and only then when you get the pkg> prompt type build IJulia

1 Like

Thanks; that fixed the syntax error

Thanks; that fixed the issue; I can now start jupyterlab() successfully but still unable to run jupyter notebook(); is IJulia only for jupyterlab?

Normally, you should be able to run jupyter notebook in your terminal and have julia kernel as an option. Is julia among the options when you run jupyter notebook and click in New? Once I had a problem like this and I simply repeated using Pkg; Pkg.add("IJulia") steps and it worked for me.

You can see more about installation and running in this link.

As I wrote above, I can run jupyterlab with no error:

but I can not run jupyter notebook. When I try jupyter notebook, i get the following error:

julia> using IJulia

julia> jupyter notebook()

ERROR: syntax: extra token "notebook" after end of expression

Stacktrace:

 [1] top-level scope at REPL[1]:0

Ahhhh, I see. The way that I run jupyter notebook is directly in the Terminal, not in the julia REPL. Try exit() and then run jupyter notebook.

At the Julia prompt, you run

using IJulia
notebook()

not jupyter notebook — the latter is shell syntax (e.g. for the terminal), not a Julia function.

1 Like

i am now getting different error when I open the jupyter, see below