Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7032 Discussions

DLL load failed while importing _mklinit

rootsmusic
Novice
2,862 Views

I'm reporting an issue with importing mkl.  In a conda environment, I installed the Intel packages below.

# packages in environment at C:\ProgramData\Anaconda3\envs\DS:
# Name Version Build Channel
bzip2 1.0.8 vc14hd4456ca_9 [vc14] intel
ca-certificates 2023.01.10 haa95532_0 intel
certifi 2022.12.7 py39haa95532_0 intel
daal4py 2023.1.1 py39_intel_48681 intel
dal 2023.1.1 intel_48681 intel
dpcpp-cpp-rt 2023.1.0 intel_46319 intel
dpcpp_cpp_rt 2023.1.0 intel_46319 intel
fortran_rt 2023.1.0 intel_46319 intel
icc_rt 2023.1.0 intel_46319 intel
impi_rt 2021.9.0 intel_43421 intel
intel-cmplr-lib-rt 2023.1.0 intel_46319 intel
intel-cmplr-lic-rt 2023.1.0 intel_46319 intel
intel-fortran-rt 2023.1.0 intel_46319 intel
intel-opencl-rt 2023.1.0 intel_46319 intel
intel-openmp 2023.1.0 intel_46319 intel
intelpython 2023.1.0 1 intel
joblib 1.2.0 pyh3f38642_0 intel
mkl 2023.1.0 intel_46356 intel
mkl-service 2.4.0 py39h9d02d91_15 intel
mkl_fft 1.3.5 py39h11997cf_11 intel
mkl_random 1.2.2 py39hb8cdf03_51 intel
mkl_umath 0.1.1 py39h7cd8e37_61 intel
numpy 1.23.5 py39hb1a71d1_7 intel
numpy-base 1.23.5 py39he7338a5_7 intel
openssl 1.1.1t h2bbff1b_0 intel
pip 23.0.1 py39haa95532_0 intel
python 3.9.16 h8c1d659_1 intel
scikit-learn 1.2.1 py39hd77b12b_0 intel
scikit-learn-intelex 2023.1.1 py39_intel_48681 intel
scipy 1.7.3 py39hfcc2dce_8 intel
setuptools 65.6.3 py39haa95532_0 intel
six 1.16.0 pyhd3eb1b0_1 intel
sqlite 3.41.1 h2bbff1b_0 intel
tbb 2021.9.0 vc14_intel_43574 [vc14] intel
tbb4py 2021.9.0 py39_intel_43574 [vc14] intel
threadpoolctl 2.2.0 pyh0d69192_0 intel
tk 8.6.12 h2bbff1b_0 intel
vc 14.2 h21ff451_1 intel
vs2015_runtime 14.27.29016 h5e58377_2 intel
wheel 0.38.4 py39haa95532_0 intel
wincertstore 0.2 py39haa95532_2 intel
xz 5.2.8 h8cc25b3_0 intel
zlib 1.2.13 h8cc25b3_0 intel

(mkl was installed as a dependency by another package.)

 

In VS Code for Windows 11, I created a .py script that runs:

import mkl

Why does its PowerShell terminal displays the error below?

PS C:\Users\roots> C:/ProgramData/Anaconda3/Scripts/activate
PS C:\Users\roots> conda activate DS
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ conda activate DS
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\roots> & C:/ProgramData/Anaconda3/envs/DS/python.exe "c:/Users/roots/OneDrive/Desktop/Python and Pandas for Data Engineering/test.py"
Traceback (most recent call last):
File "c:\Users\roots\OneDrive\Desktop\Python and Pandas for Data Engineering\test.py", line 1, in <module>
import mkl
File "C:\ProgramData\Anaconda3\envs\DS\lib\site-packages\mkl\__init__.py", line 49, in <module>
from . import _mklinit
ImportError: DLL load failed while importing _mklinit: The specified module could not be found.
Labels (1)
0 Kudos
1 Solution
ShanmukhS_Intel
Moderator
2,832 Views

Hi James,

 

Thanks for posting in Intel communities.

 

'In VS Code for Windows 11, I created a .py script that runs: Why does its PowerShell terminal displays the error below?'

import mkl

>>Could you please confirm if Intel python is installed on your system?

 

In some cases, using a different distribution of Python or a package that doesn't rely on MKL can cause the issue. You could try using Anaconda distribution, which includes the Intel MKL library by default. More details regarding the same were provided below.

 

You could use the conda package manager in installing Intel Python and all other dependent packages. You could use the below command for the same.

>> conda create -n test -c intel intelpython3_full -y

 

You could install intel mkl using conda package manager using the below command

>> conda install -c intel mkl 

 

If you have the Intel MKL library installed on your system, could you please confirm that it is properly installed and configured? If necessary, you might need to reinstall MKL or update it to a compatible version.

 

We have created a test environment and we could see mkl being imported without any issues.

 

Attached is the screenshot for your reference.

mkl import screenshot.jpg

 

Best Regards,

Shanmukh.SS

 

 

View solution in original post

0 Kudos
3 Replies
ShanmukhS_Intel
Moderator
2,833 Views

Hi James,

 

Thanks for posting in Intel communities.

 

'In VS Code for Windows 11, I created a .py script that runs: Why does its PowerShell terminal displays the error below?'

import mkl

>>Could you please confirm if Intel python is installed on your system?

 

In some cases, using a different distribution of Python or a package that doesn't rely on MKL can cause the issue. You could try using Anaconda distribution, which includes the Intel MKL library by default. More details regarding the same were provided below.

 

You could use the conda package manager in installing Intel Python and all other dependent packages. You could use the below command for the same.

>> conda create -n test -c intel intelpython3_full -y

 

You could install intel mkl using conda package manager using the below command

>> conda install -c intel mkl 

 

If you have the Intel MKL library installed on your system, could you please confirm that it is properly installed and configured? If necessary, you might need to reinstall MKL or update it to a compatible version.

 

We have created a test environment and we could see mkl being imported without any issues.

 

Attached is the screenshot for your reference.

mkl import screenshot.jpg

 

Best Regards,

Shanmukh.SS

 

 

0 Kudos
rootsmusic
Novice
2,810 Views

Thanks @ShanmukhS_Intel, I created a new environment for intelpython3_full.

0 Kudos
ShanmukhS_Intel
Moderator
2,769 Views

Hi James,


It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread


Best Regards,

Shanmukh.SS


0 Kudos
Reply