[IPython-dev] Finding the subcommand names
Akim Demaille
akim at lrde.epita.fr
Fri Feb 12 04:14:37 EST 2016
Hi,
The most recent version of IPython complains when I run `ipython notebook`:
> $ ipython notebook
> [TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions.
> [TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook`... continue in 5 sec. Press Ctrl-C to quit now.
So I obey, but it fails:
> $ jupyter-3.4 notebook
> jupyter: 'notebook' is not a Jupiter command
What? What are the existing commands?
> $ jupyter-3.4 --help
> usage: jupyter-3.4 [-h] [--version] [--config-dir] [--data-dir]
> [--runtime-dir] [--paths] [--json]
> [subcommand]
>
> Jupyter: Interactive Computing
>
> positional arguments:
> subcommand the subcommand to launch
>
> optional arguments:
> -h, --help show this help message and exit
> --version show the jupyter command's version and exit
> --config-dir show Jupyter config dir
> --data-dir show Jupyter data dir
> --runtime-dir show Jupyter runtime dir
> --paths show all Jupyter paths. Add --json for machine-readable
> format.
> --json output paths as machine-readable json
>
> Available subcommands: 3.4 kernelspec-3.4 migrate-3.4 nbconvert-3.4
> nbextension-3.4 notebook-3.4 trust-3.4
Huh, I need that -3.4 extension :(
> $ jupyter-3.4 notebook-3.4
> [I 10:09:00.941 NotebookApp] The port 8888 is already in use, trying another random port.
> [I 10:09:00.942 NotebookApp] The port 8889 is already in use, trying another random port.
But that `ipython notebook` is inside a shell script that I
provide my users with. So I need something portable. Hence
the question is: what is the advertised way to know how the
`notebook` command is to be invoked? Yeah, I can grep and
sed etc. the help message, but that’s really messy. Besides,
how do I know what conventions are used on other platforms/distros?
That `notebook-3.4` instead of `notebook` is really an additional
complexity I would have liked not to have.
FWIW, IPython/Jupyter were installed via MacPorts.
Cheers!
More information about the IPython-dev
mailing list