stata_kernel的使用

stata_kernel的使用

虽然很久之前就知道了stata_kernel这个插件,这个插件可以让我们能在Jupyter Notebook中运行Stata代码。

安装

1
pip3 install stata_kernel

这一步我在安装的时候出现了下面的错误:

1
Cannot uninstall 'pexpect'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

如果你也出现了这种错误,可以使用下面的语句安装:

1
sudo pip3 install --ignore-installed stata_kernel

然后安装:

1
python3 -m stata_kernel.install

如果这一步提示出错:

1
ImportError: Missing required dependencies ['numpy']

你需要用conda安装numpy:

1
conda install numpy

接下来安装语法高亮插件:

1
2
conda install -c conda-forge nodejs -y
jupyter labextension install jupyterlab-stata-highlight

然后就能在Jupyter notebook中使用Stata了。

使用效果:

绘图效果:

# Stata

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×