ImportError: DLL load failed while importing pysmile: the specified module could not be found

The engine.
Post Reply
Yang Yajie
Posts: 34
Joined: Thu Mar 19, 2020 11:49 am

ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by Yang Yajie »

Dear sir or madam,

I tried to import pysmile in another computer with Windows system, I download the pysmile package on the website: https://download.bayesfusion.com/files. ... y=Academia, I download the pysmile-1.6.0-win-x64-python-3.7 academic.zip and uncompress this folder, then put the pysmile.pyd into a new folder like below "WeChat Image_20210307013204.png" figure, then i create a new python file. it reminds me: ImportError: DLL load failed while importing pysmile: the specified module could not be found.
then I tried to pip install pysmile by pip install --index-url https://support.bayesfusion.com/pysmile-A/ pysmile, i get the same error;
I have tried to use pip install --index-url https://support.bayesfusion.com/pysmile-B/ pysmile, then i get the same error when I import pysmile.
the procedure as below figure1.

I also tried to create a new empty folder without anything, then create a python folder, i also get the error, it reminds me SyntaxError: invalid syntax. the error like figure 3.

the native pysmile is not installed in the local machine.

all the procedure run in Anaconda, Jupyter, I also test the same procedure by using the pysmile version that pysmile-1.6.0-win-x64-python-2.7 academic.zip

Could you please tell me why that happens? and how can I solve this problem on another computer?

Best regards!
Yajie Yang
Attachments
3.png
3.png (21.83 KiB) Viewed 9482 times
1.png
1.png (49.62 KiB) Viewed 9482 times
WeChat Image_20210307013204.png
WeChat Image_20210307013204.png (13.42 KiB) Viewed 9482 times
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by piotr [BayesFusion] »

At first, you have to unistall pysmile version 0.2

Code: Select all

pip uninstall pysmile
Second - to get the correct version from our index, use the command below:

Code: Select all

 pip install --no-cache-dir --index-url https://support.bayesfusion.com/pysmile-B/ pysmile
Note that PySMILE may not be fully compatible with the Anaconda - we recommend using the official binaries from python.org
EAly
Posts: 21
Joined: Tue Apr 14, 2020 1:16 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by EAly »

Hello,

I'm facing the same problem while trying to install pysmile for a python 3.9 (not anaconda)
I'm using a virutal environment and form within the environment I run the command:

Code: Select all

pip install --no-cache-dir --index-url https://support.bayesfusion.com/pysmile-A/ pysmile
It successfully installs pysmile and I can find the (pysmile-1.6.2.dist-info) directory inside the (site-packages) directory. I also added the pysmile_license.py file to the current working directory. However, when I import pysmile I get the error that:

Code: Select all

ImportError: DLL load failed while importing pysmile: The specified module could not be found.
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by piotr [BayesFusion] »

Have you tried to run PySMILE without using venv? Also - could you check if "home" variable in pyenv.cfg file (top of venv folder structure) points to directory which contains python39.dll file?
EAly
Posts: 21
Joined: Tue Apr 14, 2020 1:16 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by EAly »

I didn't actually try to use PySMILE outside a venv (I prefer to make this option the very last resort, in the end, this is not a very pythonic practice).
I checked the contents of the pyenv.cfg file and they are as follows:

Code: Select all

home = C:\Users\z5229837\AppData\Local\Programs\Python\Python39
include-system-site-packages = false
version = 3.9.2
So it shows that it is pointing to the folder that contains the python3.9.dll

Another side point, I've previously faced a problem with learning a model with Noisy-Max nodes, and you generously shared a pre-releasable version of SMILE that handles this issue. So my question is, does the current pySMILE version accessible through your index contains that fix?
Link of the thread discussing the Noisy-MAX issue: viewtopic.php?f=2&t=4728&p=10613#p10613
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by piotr [BayesFusion] »

Could you try to use PySMILE outside a venv? For testing purposes only - to check if it is really a problem of the virtual environment. I wasn't able to recreate an error (both inside and outside venv) so any additional information will be helpful.

PySMILE 1.6.2 should contain learning fix.
EAly
Posts: 21
Joined: Tue Apr 14, 2020 1:16 pm

Re: ImportError: DLL load failed while importing pysmile: the specified module could not be found

Post by EAly »

Thanks for your reply Piotr,

I was actually able to solve the problem by removing the venv and recreate a new one, then reinstall pysmile.

Thanks again.
Post Reply