Impossible to run jupyter-book command after installing it

285 Views Asked by At

I'm trying to use Jupyter-book to create automatical PDF from my output, but after installing it using the 'pip install -U jupyter-book' command (which runs successfully), it doesn't recognize jupyter-book when I try to run a command:

Input:

jupyter_book create Jupyter_Book_Name

Output:

SyntaxError: invalid syntax (Temp/ipykernel_16888/3781613275.py, line 1)
  File "C:\Users\MAXIME~1.DUS\AppData\Local\Temp/ipykernel_16888/3781613275.py", line 1
    jupyter_book create Jupyter_Book_Name
                 ^
SyntaxError: invalid syntax

I already try to add the init jupyter_book function in the sys.path but I get the same error, and the error arises for any command. I am working in Python 3.9.7 with Jupyter Notebook in Visual Studio Code on Windows 10.

Thank you in advance, any help would really help me.

1

There are 1 best solutions below

2
On

Looks like you're confusing a shell (bash / ...) with a Python REPL.

You're running a shell command in a Python interpreter, a bit like if you try to start Python by typing python inside a Python interpreter:

$ python   # Here I'm in bash, I run Python
Python 3.9.7 (default, Sep  3 2021, 06:18:44) 
>>> python  # Here I'm in the Python interpreter
            # typing python again...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
# Yup, calling `python` here make no sense, Python looks for a variable
# named `python` not a program named `python`, and won't find it.

So get out of a Python interpreter, find a shell (depending on your OS), and run the command again.

Oh while I'm here, it's probably not:

jupyter_book create Jupyter_Book_Name

but:

jupyter-book create Jupyter_Book_Name