bash_kernel icon indicating copy to clipboard operation
bash_kernel copied to clipboard

Remove kernelspec file on uninstall

Open payne92 opened this issue 10 years ago • 5 comments

When uninstalling with:

pip uninstall bash_kernel

the kernelspec directory & file is left behind, causing the bash kernel to still be offered in the Web UI and listed as an available kernel via the command line.

payne92 avatar Feb 22 '15 15:02 payne92

I'm not sure there's a good way to do that - installing the kernelspec files is something of a hack on the python packaging toolkit. E.g. I can't make wheels for bash_kernel and have them install the kernelspec.

takluyver avatar Feb 22 '15 16:02 takluyver

Does the kernelspec file have to be dynamically generated? If it's a static file, would the uninstall be easier to manage?

payne92 avatar Feb 22 '15 22:02 payne92

No, I don't think that would be any easier to manage.

For reference, the reason it's dynamically created is so that it refers to the Python interpreter you used to install it. I originally had a static file using python3 as the interpreter name (because I mostly use Python 3 myself), and people on Python 2 complained that the kernelspec as installed wasn't working for them.

takluyver avatar Feb 22 '15 22:02 takluyver

Hi @takluyver,

Nice work with this kernel, it's really useful!

Digging up this issue as I created a conda package for bash_kernel, but not being able to fully uninstall is a real problem. Hopefully using conda it is possible to use dedicated scripts to execute commands after installing, or before uninstalling. So it would be possible to remove the dynamically installed stuff automatically.

Is there a way to know exactly what the bash_kernel.install step creates? Or even to undo it in a clean way?

PertuyF avatar Aug 30 '19 09:08 PertuyF

For the record, clean uninstall is achieved with jupyter kernelspec uninstall bash. Use -f flag for non-interactive use.

@payne92 I guess this issue could be closed.

PertuyF avatar Sep 03 '19 15:09 PertuyF