UE 4.26 and above use Python3, so we could install 3rd packages via pip
Take the numpy for example:
In directory: <UE_Root>\Engine\Binaries\ThirdParty\Python3\Win64\Scripts
pip install numpy
The package of numpy will be here: <UE_Root>\Engine\Binaries\ThirdParty\Python3\Win64\Lib\site-packages
Then we can use numpy in python console of Unreal Enging.
import numpy as np
Note: UE 5.0 preview 1 add a new plugin: "Python Foundation Packages" which contains numpy and other packages. Be careful of conflict. In fact, I prefer managing all the 3rd packages by myself.
For computers which can't use pip, or the engine needs frequently updated and don't want to "contaminate" the contents of the engine directory, we can install 3rd-party libraries through Method 2