import pysmile error in Lunix system

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

import pysmile error in Lunix system

Post by Yang Yajie »

hi, I am going to using the HPC system to test my code because the dataset volume is heavy.
I load python first in Lunix. the version of python is "Python 3.8.2 (default, Jul 31 2020, 20:59:58) [GCC 9.3.0] on Linux ".
Then I copy the pysmile_license.py, pysmile.pyd, pysmile.so file in the WinSCP as below figure1.
after that, I load python in lunix system. then I pip install some related packages include "pip install pysmile". then in python, I import pysmile and pysmile_license, it showed "ImportError: /home/yyang/pysmile.so: invalid ELF header". In figure 2.
Could you please tell me how can I deal with this problem? I need to created DBN in the lunix system.

thanks.
Yajie
Attachments
figure 2.png
figure 2.png (63.07 KiB) Viewed 4941 times
figure 1.png
figure 1.png (66.46 KiB) Viewed 4941 times
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: import pysmile error in Lunix system

Post by piotr [BayesFusion] »

It is probably a mismatch between the PySMILE and Python version installed.

Remove pysmile.so and pysmile.pyd from directory you are trying to run program, then uninstall locally cached PySMILE package by typing:

Code: Select all

python -m pip uninstall pysmile
in your terminal.

Next, download recent version of PySMILE with command:

Code: Select all

python -m pip install --index-url https://support.bayesfusion.com/pysmile-A/ pysmile
Python should show a successful download message - something like this:

Code: Select all

Collecting pysmile
  Downloading https://support.bayesfusion.com/pysmile-A/pysmile/pysmile-1.6.0-cp27-cp27mu-linux_x86_64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 173 kB/s
Installing collected packages: pysmile
Successfully installed pysmile-1.6.0
If you do not get any errors at this stage you should be able to use PySMILE. Try it by typing e.g.

Code: Select all

import pysmile
import pysmile_license
net = pysmile.Network()
in Python console. Note that License file should be present in the folder.

I hope it helps.
Yang Yajie
Posts: 34
Joined: Thu Mar 19, 2020 11:49 am

Re: import pysmile error in Lunix system

Post by Yang Yajie »

I download the pysmile package in python and pysmile.so file in the download website page, and put the pysmile_license file in the WinSCP, then run my code in Lunix system. it showed "the ImportError: dynamic module does not define module export function (PyInit_pysmile)" as shown in the figure. Could you please tell where I was wrong?
Thanks very much!
Attachments
wrong.png
wrong.png (16.55 KiB) Viewed 4600 times
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: import pysmile error in Lunix system

Post by piotr [BayesFusion] »

It seems you installed Pysmile package from official pip repository - it is package unrelated with our PySMILE.
First - you have to uninstall this package with command:

Code: Select all

pip uninstall pysmile
Next - remove pysmile.so file from your directory and install from our index by typing:

Code: Select all

pip install --index-url https://support.bayesfusion.com/pysmile-A/ pysmile
Command above should install PySMILE version matching with Python version on your Linux system.

If installation is successfull you can use PySMILE by simple import in your Python script.
Yang Yajie
Posts: 34
Joined: Thu Mar 19, 2020 11:49 am

Re: import pysmile error in Lunix system

Post by Yang Yajie »

I uninstall pysmile first succesfully, then i remove the pysmile.so file out from WinSCP, then I download the pysmile by the code you sent to me"pip install --index-url https://support.bayesfusion.com/pysmile-A/ pysmile". it shown I download the pysmile package successfully as below figure 1. however, when i "import pysmile"and "import pysmile_license" in jupyter hub by access the lunix system, it shows error as below figure 1.

when i access the code package by putty access to the lunix system, i can import pysmile and import pysmile_license as figure 2. but i plan to access the lunix system by jupyter hub website. Could you please what should i do next?
Attachments
2.png
2.png (35.8 KiB) Viewed 4587 times
error.png
error.png (59.73 KiB) Viewed 4587 times
piotr [BayesFusion]
Site Admin
Posts: 60
Joined: Mon Nov 06, 2017 6:41 pm

Re: import pysmile error in Lunix system

Post by piotr [BayesFusion] »

Pip installs PySMILE from local cache. You have to uninstall PySMILE again (pip uninstall pysmile) and install with command: "pip install --no-cache-dir --index-url https://support.bayesfusion.com/pysmile-A/ pysmile"
Post Reply