[MMTK] ImportError: No module named Scientific_netcdf (Building Scientific Python on Windows)

Peter mmtk at maubp.freeserve.co.uk
Sun Jun 6 13:28:03 CEST 2004

Regarding building Scientific Python on Windows and problems with netCDF,

It may be a bit late for Shirley, but I also fell over this error and
had to solve it when building an installer for the newest release of
Scientific Python (for Python 2.3):

ScientificPython-2.4.6.win32-py2.3.exe, on the websites now:-


Scientific Python's setup.py file does the compile/build/install.  As
Michiel de hoon wrote in an earlier email (he prepared the Windows setup
files for ScientificPython-2.4.5), the script checks to see if it can
find the header files for netCDF.

It looks for an environment variable called NETCDF_PREFIX, and also
knows to try '/usr/local', '/usr' and '/sw' which are normal on
Unix/Linux/mac OS.  Perhaps this should include the standard locations
for Windows too?

As per the instructions inside setup.py, I found it quicker to edit
setup.py itself (rather than setting up an environment variable) and put:

netcdf_prefix = 'C:\\Python23\\'

This is because I installed my copy of Python 2.3 to C:\Python23\ and I
put the netCDF header files here:


If setup.py can't find the netCDF header files, it doesn't even try to
build the netCDF extensions, which is why later on MMTK can't find
scientific_netcdf.  Konrad says he has now added a warning message, but
watch out on Scientific Python 2.4.6 (or earlier) as it will continue
silently so you think everything worked!

If setup.py can find the netCDF header files, it tries to build the
netCDF extensions which are used in MMTK.  Make sure you installed the
header files etc. from netCDF (four files listed above), as well as the
compiled DLLs.


Shirley Hui wrote:
 > Yes I have the file Scientific_netcdf.pyd  in the directory
 > C:\Python23\Lib\site-packages\Scientific\win32. I fiddle around some
 >  more:
 > It appears that when I install Scientific through the actual
 > installer (ScientificPython-2.4.5.win32-py2.3.exe) from the web page:
 > http://starship.python.net/~hinsen/ScientificPython/
 > It works and I have no problems running the command below. However,
 > when I try and compiling Scientific via the source, I get hte
 > following errors. I was under the impression that i needed to compile
 > the Scientific source according to this site:
 > http://dirac.cnrs-orleans.fr/mmtk_wiki/WindowsInstallation
 > However, I don't believe this is necessary, infact installing
 > Scientific via the exe should probably be enough...

Yes, you are right.  Rocco Moretti wrote the original instructions for
building MMTK using MinGW ,and he says he built Scientific from source.
Perhaps at the time there was no Windows Installer available.

When I added the instructions for building MMTK using Microsoft Visual
C++ 6.0, I simple installed Scientific Python using the windows
installation program.

I as wrote above, since then I have also worked out how to compile
Scientific Python on Windows using MSVC 6.0

 > Next I compiled and installed MMTK.  I then tried running the
 > command:
 > from MMTK.Dynamics import VelocityVerletIntegrator
 > to see if I installed MMTK properly, and I got the same thing
 > happening as above for Scientific.
 > I consulted the PYTHON help and noticed that you can set an
 > environment variable called PYTHONPATH to specify where Python should
 > look for modules. I set to that be C:\Python23\Lib\site-packages.  I
 > opened a new command prompt and now it's working!
 > shirley

More information about the mmtk mailing list