- The default Python is Python 3 (i.e. the
python --version command returns "Python 3.<release number>.<bugfix number>"
- Jupyter Lab is installed
- You have a local installation of STATA
The easiest way to meet these prerequisites is to install Python via the Anaconda distribution, but that isn't required if you installed everything some other way.
- Download and install Node.js from https://nodejs.org/en/ (if you don't know which version to select, choose the Long-Term Support [LTS] release).
- Open the Finder and navigate to your home directory. Press Cmd + Shift + . to display hidden files.
- Open the .condarc file with a text editor. Replace the contents of your .condarc file with the .condarc file shown below.
- To enable syntax highlighting for STATA, open the Terminal and run the following command:
jupyter labextension install jupyterlab-stata-highlight
- The command to install the STATA kernel will differ based on your STATA version and your Python distribution:
- If you are using STATA 17, open the Terminal and run:
pip install git+https://github.com/mcaceresb/stata_kernel.git@dev-stata17-graph-fix
- If you are using STATA 16 or earlier and you installed Python via the Anaconda distribution, open the Terminal and run:
conda install stata_kernel
- If you are using STATA 16 or earlier and you installed Python in another way, open the Terminal and run:
pip install stata_kernel
- Then open the Terminal and run:
python -m stata_kernel.install