Stata integration #
Warning: This post hasn't been updated for over a year. The information may be out of date.
References #
doc:
- Call Stata using IPython magic commands — pystata documentation
- Call Stata using API functions — pystata documentation
- User Guide – nbstata
Tutorials:
Install with Anaconda/Miniconda #
In environment.yml:
dependencies:
- stata_setup
- nbstata # if want to use stand-alone stata kernel without python
- jupyterlab_stata_highlight3 # only works for stata kernelDebugging installation #
If see TypeError: init() got an unexpected keyword argument 'splash' when import the package
- Quit Jupyter
- Use
conda env listto find where the environment packages are installed. Example:/Users/<user>/miniforge3/envs/mphil-gp-stata/lib/python3.11/site-packages/stata_setup.py - Open the file with editor
- Replace
config.init(edition, splash=splash)withconfig.init(edition) - Save, deactivate and activate the environment, reload Jupyter