From: http://iwonderwhatjoeisworkingon.blogspot.com/2017/04/debugging-maya-using-visual-studio-code.html
- Install ptvsd
pip install --user ptvsd
- Start ptvsd server in Maya
import ptvsd
ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)