Installing the MKL Library for Python

I tested that the MKL library’s Python version should ideally be kept at 3.9, and not greater than 3.9, such as 3.10, 3.11, 3.12, or 3.13, as they are currently not very compatible.Therefore, when configuring, it is best to use conda, and thencreate a virtual environment.

conda create -n my_env python=3.9

Activate the virtual environment

conda activate my_env

Install the MKL runtime and optimized version of NumPy

pip3 install mkl intel-numpy

Note: intel-numpy is the version specifically optimized by Intel, but the regular NumPy combined with MKL can also achieve most of the performance improvements.Remember: the mkl module itself does not provide mathematical operation functions; it is merely a configuration interface. The actual mathematical operations are performed through libraries like NumPy/SciPy, which use MKL for acceleration at the lower level.

Leave a Comment