1

I'm trying to run jupyter notebook.

For some reason, I get the error that jupyter is not a command :(

I looked at Running jupyter via command line on Windows user6094431's answer.

What does Python -m mean?

As in python -m notebook.

I used pip to install Jupyter.

"jupyter notebook" doesn't work btw.

89f3a1c
  • 1,430
  • 1
  • 14
  • 24
code lover
  • 151
  • 1
  • 2
  • 9
  • This topic is extensively explained here https://stackoverflow.com/questions/22241420/execution-of-python-code-with-m-option-or-not – MGP Jul 22 '19 at 22:11

1 Answers1

5

The -m you're asking about is one of the command line flags that the Python interpreter recognizes. It tells the interpreter to take the next thing on the command line and treat it as a module name, like in an import statement. The named module will be used as the main module in the interpreter, like a script.

If you want to follow the advice of that answer, you need to go to an command line, and type in, literally python -m notebook. The first word is the program to run, the -m and notebook are arguments.

On Windows, the Python interpreter might not be in your PATH by default. If that's the case, you can instead try running py, which is a helper program that can run any installed Python interpreter. If you have more than one interpreter installed, you might need to pass a flag telling py which version you want (e.g. py -3.7 -m notebook). Extra arguments to py will be passed on to the Python interpreter, so -m should work fine.

Blckknght
  • 100,903
  • 11
  • 120
  • 169