Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.

Import Error for Intel Packages

Djordjic__Marko
Beginner
1,261 Views
OS: Windows 10
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
 
After performing clean install of native Python (without numpy, pandas, and etc.), inside specific virtual environment, and installing of intel-sklearn with: 
 
pip install intel-scikit-learn subsequent error has appeared:
 
Subsequent error has appeared, making usage of the packages impossible:
 
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.
 
Original error was: DLL load failed: The specified module could not be found.
0 Kudos
5 Replies
Djordjic__Marko
Beginner
1,261 Views

I have posted this topic, but there are no replies. The same error has been reported by other forum members. When we can expect that it will be resolved.

0 Kudos
Sergey_M_Intel2
Employee
1,261 Views

Hello Marko,

We are looking into this issue.

Sergey

0 Kudos
Djordjic__Marko
Beginner
1,261 Views

Dear Sergey thank you so much!

Regards,

Marko.

0 Kudos
Rohit_J_Intel
Employee
1,261 Views
Hi,
 
I investigated this further and was able to root-cause the underlying problem - the issue lies with how virtualenv patches PATH variable once the activation script is run. The python virtualenv module generates a template-based activation script which doesn't account for extra set of directories that ought to be added to PATH for installed binaries to work correctly. Proposed work-around for current behavior of virtualenv is to ensure that activation script adds those required directories to PATH.
 
For example:
1. Create a venv called "test"
.\Scripts\virtualenv.exe test
2. Open ".\test\Scripts\activate.bat" in an editor
Change this line :
set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"
To:
set "PATH=%VIRTUAL_ENV%\Scripts;%VIRTUAL_ENV%\Library;%VIRTUAL_ENV%\Library\bin;%PATH%"
3. Activate "test" venv
 
Inside this venv, you would be able to install and use our packages. And since the change is at the environment-activation-script level, all the required set of directories would be set to PATH, and would hence be a one-time setup for that venv. 
 
Hope this helps!
 
Thanks,
Rohit
0 Kudos
Djordjic__Marko
Beginner
1,261 Views

Dear Rohit, thank you very much for your support. Now, after adjusting the path, everything is working correctly.

I hope there will be a benefit to others if similar problem is encountered.

Thank you once again.

Best regards,

Marko.

0 Kudos
Reply