Ask Your Question

Updating scipy in sage

asked 2011-01-28 20:04:39 +0200

Shashank gravatar image

updated 2011-04-28 19:11:03 +0200

Kelvin Li gravatar image

I am trying to use the "griddata" from "scipy.interpolate". However, the scipy present in scipy is version 0.7 and griddata is implemented 0.9 onwards. Is there a way to upgrade scipy to version 0.9 in sage? I understand that 0.9 is a development version but is there a way to upgrade just scipy to development version?

edit retag flag offensive close merge delete


This won't help you per se, but Scipy 0.8 is actually in Sage 4.6.1.

kcrisman gravatar imagekcrisman ( 2011-01-29 21:56:25 +0200 )edit

4 Answers

Sort by ยป oldest newest most voted

answered 2011-02-09 01:25:24 +0200

Jason Grout gravatar image

One thing you could try to install a newer scipy is to download scipy and follow the instructions for installation, but instead of doing "python ...", do "sage -python ..." (i.e., instead of calling python, call sage -python, which will use Sage's version of python).

edit flag offensive delete link more

answered 2011-04-27 16:37:10 +0200

I had this problem and was able to use "from matplotlib.mlab import griddata". I'm playing with portable python which appears to have:

matplotlib version 0.98.52 scipy version 0.7.0.dev5180 and numpy version 1.2.1

The matplotlib.mlab version of griddata accepts exactly 5 arguments like this: zi = griddata(x,y,z,xi,yi) and uses delauney nearest neighbor triangulation.

Hope that helps!

edit flag offensive delete link more


@flutefreak7: sage 4.7 is about to be released in the next few days i think (it's currently at release candidate 0), and it includes scipy 0.9 - so hang tight!

Felix Lawrence gravatar imageFelix Lawrence ( 2011-04-27 20:09:30 +0200 )edit

answered 2011-02-11 04:30:16 +0200

fbissey gravatar image

You can try something very dirty that will probably work. Sage's spkg are stored in spkg/standard. I assume you have a tarball for scipy-0.9.

1) go to spkg/standard

2) tar xvfj scipy-0.8

3) cd scipy-0.8

4) rm -rf src/

5) mkdir src

6) untar the scipy-0.9 tarball

7) copy the content of the scipy-0.9 folder in the src folder

8) going back to spkg/standard

9) mv scipy-0.8 scipy-0.9

10) tar cvf scipy-0.9.tar scipy-0.9

11) bzip2 scipy-0.9.tar

12) mv scipy-0.9.tar.bz2 scipy-0.9.spkg

13) cd ../..

14) sage -f scipy-0.9

15) wait for scipy-0.9 to install (cross fingers)

16) start sage (no need for sage -b scipy is a runtime dependency not a build time one)

17) enjoy scipy-0.9 in sage - hopefully

edit flag offensive delete link more


And if you try this, let us know if it works, and what platform you are on! That would help with our goal of updating Scipy in the near future.

kcrisman gravatar imagekcrisman ( 2011-02-11 12:57:14 +0200 )edit

I was lazy about trying this but it does not work. scipy 0.9.0 rc needs numpy 1.5.1. The numpy version in sage is older. I might have to do the same with numpy

Shashank gravatar imageShashank ( 2011-02-21 15:48:13 +0200 )edit

I built sage 5.9 from source, then applied this procedure to successfully update scipy 0.11 to scipy 0.12 (May 7 2012)

Noah gravatar imageNoah ( 2013-05-07 12:55:20 +0200 )edit

answered 2011-01-29 22:01:43 +0200

kcrisman gravatar image

There are a couple ways to do this, I think.

  • My preferred way is that you try to upgrade the spkg (Sage package) currently in Sage (0.8) to the next release (if it's stable) and then begin the review process. Instructions for how to do this are here in the developer guide.

  • Since that is probably more work than you would like just to use it, I think you should be able to use a separately downloaded Scipy from within your Sage by importing it. I'm not quite sure where it would have to live, nor whether you'd have to name it something different. But since Sage is essentially Python-based, you could at least try sage: sys.path.append('/path/to/my-scipy-dir'); import my-scipy or something like that. If this is totally wrong, undoubtedly someone will let me know.

edit flag offensive delete link more


I tried the second option. I am not very good at python but I was not able to do it with my limited python knowledge. I have scipy install on my machine. I can call 0.9.0 commands (griddata) when I use standalone python in the terminal but i cannot wrap it with sage.

Shashank gravatar imageShashank ( 2011-01-29 22:22:28 +0200 )edit

0.9 is just about to be released (I believe scipy is currently at 0.9rc4). I've been watching it and waiting for them to release 0.9 before upgrading the Sage spkg.

Jason Grout gravatar imageJason Grout ( 2011-02-19 13:38:58 +0200 )edit

Thanks for the information. What is the time scale we are talking about? Right now I managed to install scipy 0.9.0 on my machine. I just divided my scipy part and sage part. I run the scipy part on my system python and pass the output to sage later. It is a bit cumbersome that way.

Shashank gravatar imageShashank ( 2011-02-19 15:34:48 +0200 )edit

Well first scipy 0.9 needs to be released. Then probably one or two Sage releases after that. So probably at least a month.

Jason Grout gravatar imageJason Grout ( 2011-02-21 16:45:20 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-01-28 20:04:39 +0200

Seen: 1,606 times

Last updated: Apr 27 '11