- 1 year ago
How to use non-mkl NumPy under Anaconda?
To use a non-MKL (Intel Math Kernel Library) version of NumPy under Anaconda, you can install the nomkl
package. This package provides a version of NumPy that does not rely on the Intel MKL libraries. Here's how you can do it:
Open the Anaconda Prompt (Windows) or a terminal (Linux/macOS).
Create a new conda environment (optional, but recommended):
It's a good practice to create a new environment for installing packages to avoid conflicts.bashconda create -n myenv python=3.8
conda activate myenv
Replace
myenv
with your desired environment name.Install the
nomkl
package:
Use the following command to install thenomkl
package along with the desired version of NumPy.bashconda install nomkl numpy
This will install the
nomkl
package and NumPy without using the Intel MKL libraries.Verify the installation:
You can verify that you are using the non-MKL version of NumPy by importing NumPy and checking its configuration:pythonimport numpy as np
print(np.show_config())
Look for the line that says
"blas_mkl_info": "NOT AVAILABLE"
to confirm that the MKL libraries are not being used.
Please note that the performance of NumPy operations might be different with the non-MKL version. Depending on your use case, you might want to evaluate the performance impact before using the non-MKL version in production.