ipystata
ipystata copied to clipboard
Autodetect path of Stata binary
There are ways to get the location of the stata binary by calling the winreg package and looking for some keys. There is an example here for instance:
https://github.com/sergiocorreia/StataEditor/blob/master/StataEditorPlugin.py#L507
It's not perfect but it works quite well for Stata 12-14
Thanks, that is a great suggestion. I was already playing with the idea of including the ability to automatically register a Stata installation for a given path, combining this with that snippet would essentially automate most of the configuration process. I will put it on my to-do list.
This function autodetects the Stata path on Windows.
https://github.com/kylebarron/stata_kernel/blob/dcb590adb7098dfe695491dc5ae7eb404309bfa3/stata_kernel/install.py#L54-L70
The StataEditor function seemed old and didn't work on my Windows 10 VM