On 29/06/12 20:23, Scott Maddox wrote:
> Hi all,
> 
> Is there any way to use scipy functions in a custom import module? When
> I try to import scipy.interpolate I get the following error:
> 
> Error loading plugin
> /Users/smaddox/sshfs/share-scott-mirror/code/XRD/veusz_rsm.py
> 
> Traceback (most recent call last):
> 
> File "veusz/document/doc.pyc", line 392, in loadPlugins
> 
> File "/Users/smaddox/sshfs/share-scott-mirror/code/XRD/veusz_rsm.py",
> line 4, in <module>
> 
> ImportError: No module named scipy.interpolate
> 
> 
> I assume this means veusz is using it's own python installation. Is
> there an easy way to get it to use another installation, which already
> contains scipy?

It depends which version of Python your scipy is compiled for and
whether it is compatible with the numpy that veusz is using (1.6.1). If
it matches the python that veusz is using and the ABI is ok, you're
fine. If not, then no (unless you build scipy under a matching
environment). I'm using 2.7 for Windows and Mac OS (using the Python.org
python versions). I'm using a rather old Mac build environment, though,
so it's possible that this will not work.

The trick is to either set the PYTHONPATH environment variable to
include the directory that the scipy distribution is in before running
Veusz (from that shell), or to add a Veusz plugin which just modifies
the Python path, e.g.

import sys
sys.path.append('/Libraries/Frameworks/Python.framework/Versions/2.7/lib/pthon2.7/site-packages')

I could add an option to Veusz to add directories to the PATH if this
would help.

Jeremy





_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à