[SciPy-user] Matlab IO -- can others with matlab test this bug?

Zachary Pincus zachary.pincus@yale....
Tue Jul 29 07:42:51 CDT 2008


Hi Jonny,

> I'd be happy to test the latest SVN checkout if someone could tell me
> how I might build this in place (when I try and import from the scipy
> directory directly it tells me that it needs to be installed which I
> don't want to do as I want to leave the existing release version
> installed).
>
> Is there an easy way to go about using/modifying/testing the SVN
> checkout without installing it each time one makes changes?

Perhaps some others can chime in with more "official" methods, but I  
typically do one of several things to test SVN versions:

(1) I cd to the build/lib-whatever subdirectory, after 'python  
setup.py build'. This dir contains a mostly-complete scipy install.  
After starting python and making sure that '.' is first on the  
sys.path (so that the scipy dir in that directory shadows the system  
one), 'import scipy' should get the new version. Alternately, you can  
start python from anywhere, and then do 'import sys; sys.path.insert('/ 
path/to/build/lib...', 0); import scipy' to get the same effect.

(2) The above method fails for certain things like using f2py, which  
needs certain source files that get installed, but not copied over  
into build/lib. In those cases, you can install scipy into an  
alternated location somewhere, and then add that to sys.path (or to  
the PYTHONPATH environment variable). Use the '--install-base' or '-- 
prefix' switch to 'python setup.py install' to control where the files  
get installed. I'm not really sure which is most appropriate here.

(3) In this particular case, scipy.io.matlab doesn't involve any  
compiled modules. You could just cd to scipy/io/matlab in the SVN  
checkout, and then 'import mio' should work. The desired function is  
mio.savemat....

Zach








More information about the SciPy-user mailing list