Installing the PySMILE wrapper for spyder/anaconda 14.04

The engine.
Post Reply
Marijn Peppelman
Posts: 23
Joined: Mon Jul 08, 2019 3:14 pm

Installing the PySMILE wrapper for spyder/anaconda 14.04

Post by Marijn Peppelman »

Hello.

This might be a stupid question, but what steps do i need to follow to actually get the library installed, so i can import it?
The wraper manual only says i need to use "import pysmile", but that does not seem to work in my case.
I'm currently using the Spyder IDE which comes with the anaconda python distribution, and when i try to use "import pysmile" i get this error:

Code: Select all

runfile('/home/vagrant/sync/dev/BN_Exploration_SMILE.py', wdir='/home/vagrant/sync/dev')
Traceback (most recent call last):

  File "<ipython-input-4-7e2367f3e688>", line 1, in <module>
    runfile('/home/vagrant/sync/dev/BN_Exploration_SMILE.py', wdir='/home/vagrant/sync/dev')

  File "/home/vagrant/anaconda3/envs/SMILE/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "/home/vagrant/anaconda3/envs/SMILE/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/home/vagrant/sync/dev/BN_Exploration_SMILE.py", line 8, in <module>
    import pysmile

ImportError: libmvec.so.1: cannot open shared object file: No such file or directory
This happens even though i have pasted the pysmile.so into both the working directory and the anaconda3/lib folder.
It's detecting something, since i get the error "ModuleNotFoundError: No module named 'random_bs' " if i try to import a random non-existent thing.
I'm using a conda virtualenv specifically so that i can use python version 3.6.9, in stead of 3.7.x, since the current version of the wrapper is for python 3.6.
Last edited by Marijn Peppelman on Mon Sep 23, 2019 5:10 pm, edited 1 time in total.
Marijn Peppelman
Posts: 23
Joined: Mon Jul 08, 2019 3:14 pm

Re: Installing the PySMILE wrapper for spyder/anaconda on Ubuntu 14.04

Post by Marijn Peppelman »

I think i might have found it, this appears to be yet another element of me using an outdated OS.
It appears libmvec is a vector library added in Glibc 2.22, and ubuntu 14.04 is stuck at Glibc 2.19.
I'm trying a manual compilation of Glibc 2.24

If that doesn't work, i'm just getting a new OS and see if that resolves things.

EDIT: success! basically followed https://blender.stackexchange.com/quest ... bmvec-so-1:

Code: Select all

cd /opt
wget https://ftp.gnu.org/gnu/libc/glibc-2.24.tar.gz
tar -xvzf ./glibc-2.24.tar.gz
cd glibc-2.24
mkdir _build
cd _build
../configure --enable-kernel=3.2 --prefix=/usr
make

cd ~/anaconda3/lib #or whatever your Anaconda3/python lib folder is
ln -s /opt/glibc-2.24/_build/mathvec/libmvec.so ./libmvec.so.1
ln -s /opt/glibc-2.24/_build/math/libm.so ./libm.so.6
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Installing the PySMILE wrapper for spyder/anaconda 14.04

Post by shooltz[BayesFusion] »

General note for both jSMILE and PySMILE:

While we minimize the external binary dependencies in the wrappers, it's simply not possible to provide a single binary for Linux which will work with all Linux distributions. We can build the wrapper for specific platform if required.
Post Reply