[Bf-python] Loading shared library in Blender Python

Arnaud Degroote arnaud.degroote at laas.fr
Wed Jun 17 16:53:56 CEST 2015


On 17/Jun - 15:59, Sybren A. Stüvel wrote:
> Hi Pierrick,
> 
> On Wed, Jun 17, 2015 at 03:49:23PM +0200, Pierrick Koch wrote:
> > I'd like to imort python package from ubuntu distribution into
> > blender. Their shared object extension is
> > .cpython-34m-x86_64-linux-gnu.so, while Blender look for
> > .cpython-34m.so (without "-x86_64-linux-gnu").
> 
> How did you gather this knowledge? It helps a lot to see what you're
> actually doing.

To be more precise, what we try is doing

import numpy

which fails with 

ImportError: cannot import name 'multiarray'

(whole discussion is here : https://github.com/morse-simulator/morse/pull/630)

It basically fails because python from Ubuntu is built with multiarch
option and so the libraries have extension cpython-34m-x86_64-linux-gnu.so.
It is not the case of the python embedded in binary blender.

Of course, it is always possible, in this case, to use the numpy copy
from blender (but it is not a generic solution), or to hack the
filesystem (but it is cumbersome for users).

Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20150617/94b62cc6/attachment.sig>


More information about the Bf-python mailing list