kylebarron / stata_kernel

A Jupyter kernel for Stata. Works with Windows, macOS, and Linux.
https://kylebarron.dev/stata_kernel/
GNU General Public License v3.0
266 stars 57 forks source link

Multiple kernels #400

Closed tatanlabra closed 2 years ago

tatanlabra commented 3 years ago

Would be useful, at least for my workflow, have different versions of Stata installed on the machine and available as kernels (Stata 15, 16 and 17). It's possible right now?.

mcaceresb commented 3 years ago

@tatanlabra One (possibly annoying) workaround is to modify ~/.stata_kernel.conf and manually specify stata_path = /path/to/stata/15_or_16. If that works you might be able to write a short script to modify that file and launch the kernel.

kylebarron commented 3 years ago

Theoretically we could have multiple configuration files, and some way to specify which config file you want when you start Stata.

tatanlabra commented 3 years ago

Thanks for your answers!. I'm unclear how to call the script as @mcaceresb suggest, can you give me a hint please. And, as @kylebarron pointed out (if I understand correctly), making a duplicate of kernel_config file, pointing to different paths is enough, duplicate the kernel too isn't necessary?

mcaceresb commented 3 years ago

@tatanlabra Actually, @kylebarron is totally right. I forgot this functionality was added to deal with a different issue. I just tried out multiple config files and that did the trick for me. You have to define the environment variable STATA_KERNEL_USER_CONFIG_PATH, like so:

STATA_KERNEL_USER_CONFIG_PATH=/path/to/custom_stata_kernel.conf
# start stata kernel in same console

Tested this out on Linux and it worked. Hope if works on your OS as well!