[Edu-sig] Introducing Python to Engineering Students

David MacQuigg macquigg at ece.arizona.edu
Wed Mar 19 21:53:23 CET 2008

Our mandelbrot demo is working nicely, thanks to all the help I've gotten from folks on this list.  We are using only the weave package, not the full SciPy install.  It would be nice to show some additional examples from SciPy, however, especially tools that students will find useful in later classes.

The problem is I'm not sure SciPy is ready for prime time in the undergraduate curriculum.  It will look bad if this package is not as good as Matlab, which is what the students at U of A are using in many of their other courses.  I would like to get some opinions on this issue from others who may have been here before.

Here are my experiences so far in getting started with SciPy, trying to run it as I expect our students would, on their own machines rather than the department's Solaris machines.

1) I'm using a Windows XP machine, similar to what most of the students are using, so anything we want them to install on their own computers must work under Windows, or at least under Cygwin.  Most students don't have Cygwin installed, but we can consider that as part of the package if we decide to go that route.  Cygwin adds benefits beyond SciPy, of course, but disk space may be an issue.

2) I tried a direct install under Windows using the installers
  from http://www.scipy.org/Download
  NumPy 1.0.4 for Python 2.5 - numpy-1.0.4.win32-py2.5.msi
  SciPy 0.6.0 for Python 2.5 - scipy-0.6.0.win32-py2.5.exe

The installs ran without error, but when I tried running the test scripts from each of these packages under Python 2.5, all I got was the useless "tell Microsoft" window.  
>>> import numpy, scipy 
>>> numpy.test() 
python.exe has encountered a problem .. please tell Microsoft ... 
>>> scipy.test() 
python.exe has encountered a problem .. please tell Microsoft ... 
I guess the problem is that I have not installed Microsoft's C-compiler, but neither the installers nor the test scripts tell me that.  There does not seem to be any un-install utility, so I will just delete numpy/ and scipy/ from C://Python25/Lib/site-packages/ and hope that no problems remain from registry entries, egg-info files, and other gradoo left by the installers!

3) I then tried installing under Cygwin, following the incomplete instructions at http://scipy.org/Installing_SciPy/Windows

  from http://www.scipy.org/Download
  NumPy 1.0.4 - numpy-1.0.4.tar.gz
  SciPy 0.6.0 - scipy-0.6.0.tar.gz

3a) The numpy install and test ran without error.  
$ pwd 
$ python setup.py install 
$ python -c 'import numpy; numpy.test()' 
Ran 692 tests in 1.593s 
3b) The scipy install hit some snags, however, ending in a corruption of Cygwin that could only be fixed with a full reboot.

$ python setup.py install
--> NOT AVAILABLE:  mkl, fftw3, rfftw, drfftw, ptf77blas, f77blas, ...

Restarted cygwin bash shell:
  13283 [main] ? (5388) C:\cygwin\bin\bash.exe: *** fatal error - system shared
memory version mismatch detected - 0x75BE009C/0x8A88009C.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version.  The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution.  Rebooting is also suggested if you
are unable to find another cygwin DLL.

4) I then installed just the weave package from scipy, and except for a few warnings during the test run, it seems to be OK.

5) I did a google search on [scipy install] and found others having similar problems over the years.  One fellow had success with the installer at http://www.enthought.com/products/epdacademic.php.  I downloaded that one and ran it, a process which took several hours and created a Python25 directory with 719MB and 38814 files!!!  sys.path is now crammed with 116 really messy paths.  Luckily, I kept all this separate from my normal Python install.

6) I tried testing the new install.  Numpy passed all tests, and SciPy got a little further, but ended with a crash.  The error messages, as usual, mean nothing.
.... vq.py:477: UserWarning: One of the clusters is empty.  Re-run kmean with a different initialization.
Running tests:
crash - "python.exe has encountered a problem and needs to close ..."

7) I tried running the SciPy tutorial at http://www.scipy.org/SciPy_Tutorial in hopes that whatever failed was in some obscure function I won't need.  No such luck.  2 out of 4 of the tutorials crashed Python.
Basic Matrix Operations - OK
Sparse Matrices - OK
Numerical Integration - function quad crashes Python
Integrating ODEs - function odeint crashes Python

I see that Enthought has a nicely organized webpage, including a http://www.scipy.org/Developer_Zone where they are asking for help with packaging.  The two environments most used by our students (PC and Macintosh) have nobody volunteering to do the packaging.

What I can't tell from just a few days investigation is where is SciPy heading?  Will things be working smoothly soon, or is it being eclipsed by Matlab?  I've worked on both open-source and commercial projects, and I know there are some project that just don't fit one or the other model.  Open-source is best when you have millions of users and thousands of potential developers.  Commercial is best when there are fewer users, and those users are not typically computer experts.

Thoughts anyone?

-- Dave

At 09:30 PM 3/13/2008 -0700, Rob Malouf wrote:

>Ugh!  I'm afraid I don't use windows, so I can't offer any advice.  I  
>do know that compiling scipy wasn't that difficult under linux or mac  
>os x, so it shouldn't be too bad under cygwin either.  There are few  
>extra libraries you need, but you can probably find binaries for them  
>out there somewhere.  In fact, I'm surprised there isn't a cygwin  
>binary for scipy... if you get it working maybe you should post it  

More information about the Edu-sig mailing list