Python Jupyter Notebook: install packages under the current working environment

In Jupyter Notebook, use the below command within the notebook to install packages in the current working environment. This is specifically useful when you are working in the notebook, and need to install new packages to the matching python version you are using.

!{sys.executable} -m pip install XXX