Jupyter commands work only with a dash (e.g. jupyter-kernelspec instead of jupyter kernelspec) Jupyter commands work only with a dash (e.g. jupyter-kernelspec instead of jupyter kernelspec) python-3.x python-3.x

Jupyter commands work only with a dash (e.g. jupyter-kernelspec instead of jupyter kernelspec)


Well, I figured out what's wrong. Using the shutil module, in some Windows versions which('jupyter-kernelspec') returns None, because of the missing .exe, although the PATHEXT environment variable contains both .exe and .EXE.

(This seems to be linked to this: shutil.which() not finding programs without appending file extension although I am not convinced because which(jupyter-kernelespec.EXE) using shutil works fine for me...)

So, one has to add the .exe to the argument of jupyter like this:

jupyter kernelspec.exe list

Because this kind of command is used by most Jupyter kernel installers, you won't always be able to go debug and check where you need to add it.The fix consists in adding this:

if cmd[-4:] != '.exe':    cmd = cmd + '.exe'

right before this line:https://github.com/jupyter/jupyter_core/blob/f1e18b8a52cd526c0cd1402b6041778dd60f20dc/jupyter_core/command.py#L102

I'll try to raise this point with shutil module people.

I've updated also the github issue and closed it.https://github.com/jupyter/jupyter/issues/381


Does your PATHEXT environment variable have a trailing semicolon? If so, it may be the same issue described in the similar issue you mentioned in your answer: shutil.which() not finding programs without appending file extension

Remove any trailing semicolon from PATHEXT and try again.