[Bf-python] Loading shared library in Blender Python

Arnaud Degroote arnaud.degroote at laas.fr
Thu Jun 18 08:47:15 CEST 2015


On 17/Jun - 17:16, Sybren A. Stüvel wrote:
> On Wed, Jun 17, 2015 at 04:53:56PM +0200, Arnaud Degroote wrote:
> > 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).
> 
> Alternatively, you could recompile Blender yourself, it then works
> with the platform Python. This is on my machine:

It is what I do, and why I do not encounter the issue myself. Through,
it is not a really good alternative for our users. 
> 
> >>> import sip
> >>> sip.__file__
> '/usr/lib/python3/dist-packages/sip.cpython-34m-x86_64-linux-gnu.so'
> 
> However, that won't help your users if you want to distribute a binary
> extension.
> 
> I don't know how much effort it would be to compile Blender with
> multiarch-Python by default, and what kind of incompatibilities it
> would give on other platforms/distributions. Maybe someone else can
> comment on this?
> 
> -- 
> Sybren A. Stüvel
> 
> http://stuvelfoto.nl/
> http://stuvel.eu/



> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python

-------------- 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/20150618/0485cc09/attachment.sig>


More information about the Bf-python mailing list