ich möchte im Rahmen meines Praktikums eine Python-Kopplung zwischen zwei Modellen (Thema: Modellierung in der Hydrologie) wieder herstellen. D.h. diese Kopplung als gw.py-Datei lief schon mal, soll jetzt aber auf Python 2.4 laufen. Dabei habe ich einige Probleme!
Die Pythondatei wird von der Modellkopplungdatei gw.cpp gerufen. Ich habe dies im Debugger verfolgt und folgende Schritte funktionieren auch, inhaltliche Hintergründe nun einmal außen vor:
gw.py -->
import mf2000exe.py (datei mf2000.py vorhanden!)
dort wird dann "import output" gerufen, diese output.py funktioniert auch
dann wird dort "import netcdf.NetCDF" gerufen, dabei ist die Datei NetCDF.py im Verzeichnis /netcdf auch vorhanden, dort liegt auch die netcdf.dll (für python24.dll).
In NetCDF.py kommt folgender Code:
Code: Alles auswählen
else:
# This is the real code.
from Scientific_netcdf import *
from Scientific_netcdf import _C_API
import os
_NetCDFFile = NetCDFFile
def NetCDFFile(filename, mode=None, history=None):
filename = os.path.expanduser(filename)
args = (filename,)
if mode is not None:
args = args + (mode,)
if history is not None:
args = args + (history,)
return apply(_NetCDFFile, args)
del sys
Code: Alles auswählen
from Scientific_netcdf import *
from Scientific_netcdf import _C_API
Diese Datei liegt aber im Verzeichnis als .pyd, .pyc und .py
netcdf.dll ist vorhanden, _init_.py auch.
Nun habe ich im Terminal ein paar tests gemacht:
Code: Alles auswählen
C:\DOCUME~1\PRAKTI~1.INT>python
Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import numpy
>>> import Scientific
>>> from Scientific_netcdf import *
Fatal Python error: can't initialize module Scientific_netcdf
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
C:\DOCUME~1\PRAKTI~1.INT>
Ich weiss wirklich nicht mehr weiter und habe schon einige Versionen der netcdf.dll aus dem Netz ausprobiert. Davor hatte ich Fehler, weil ich python23.dll's installiert hatte, welche aus allen Verzeichnissen entfernt wurden.
Ich habe in der netcdf.dll Datei nachgesehen, welche DLLS dort gerufen werden:
python24.dll
msvcrt.dll
msvcr71.dll
kernel32.dll
(alle vorhanden!!!)
Weiss jemand rat und Linktipps oder hatte ähnliche Probleme? Ich antworte auch gerne mit weiteren Angaben, falls welche fehlen. Vielen Dank
Michael