f2py and pygtk on windows
import gtk import foo # where foo is any f2py-wrapped program
Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information." Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually. This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page). This happens even for very simple fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this. Regards, Sameer Grover
On 3/9/2012 11:50 AM, Sameer Grover wrote:
import gtk import foo # where foo is any f2py-wrapped program
Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually.
This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page).
This happens even for very simple fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello
I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this.
Regards, Sameer Grover
The error can be due to memory corruption. It works for me with msvc9/ifort builds of the pygtk and f2py extensions. Which DLLs does foo.pyd depend on (use DependencyWalker)? Christoph
On 10 March 2012 02:23, Christoph Gohlke <cgohlke@uci.edu> wrote:
On 3/9/2012 11:50 AM, Sameer Grover wrote:
import gtk import foo # where foo is any f2py-wrapped program
Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually.
This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page).
This happens even for very simpl fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello
I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this.
Regards, Sameer Grover
The error can be due to memory corruption. It works for me with msvc9/ifort builds of the pygtk and f2py extensions.
Which DLLs does foo.pyd depend on (use DependencyWalker)?
Christoph _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
The .pyd file generated by f2py depends on the following KERNEL32.DLL MSVCRT.DLL LIBGCC_S_DW2-1.DLL LIBGFORTRAN-3.DLL PYTHON27.DLL It is possible that this is a mingw32 problem. I haven't been able to try using ifort/msvc.(mscv is somehow not getting installed on my system, but that's a separate issue). Sameer
On 3/10/2012 9:31 PM, Sameer Grover wrote:
On 10 March 2012 02:23, Christoph Gohlke<cgohlke@uci.edu> wrote:
On 3/9/2012 11:50 AM, Sameer Grover wrote:
import gtk import foo # where foo is any f2py-wrapped program
Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually.
This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page).
This happens even for very simpl fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello
I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this.
Regards, Sameer Grover
The error can be due to memory corruption. It works for me with msvc9/ifort builds of the pygtk and f2py extensions.
Which DLLs does foo.pyd depend on (use DependencyWalker)?
Christoph _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
The .pyd file generated by f2py depends on the following
KERNEL32.DLL MSVCRT.DLL LIBGCC_S_DW2-1.DLL LIBGFORTRAN-3.DLL PYTHON27.DLL
It is possible that this is a mingw32 problem. I haven't been able to try using ifort/msvc.(mscv is somehow not getting installed on my system, but that's a separate issue).
Sameer
Can you try linking to the msvc9 runtime DLL? E.g. f2py.py -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr90 -m foo foo.f Christoph
On Monday 12 March 2012 12:26 AM, Christoph Gohlke wrote:
On 3/10/2012 9:31 PM, Sameer Grover wrote:
On 10 March 2012 02:23, Christoph Gohlke<cgohlke@uci.edu> wrote:
On 3/9/2012 11:50 AM, Sameer Grover wrote:
> import gtk > import foo # where foo is any f2py-wrapped program Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually.
This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page).
This happens even for very simpl fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello
I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this.
Regards, Sameer Grover The error can be due to memory corruption. It works for me with msvc9/ifort builds of the pygtk and f2py extensions.
Which DLLs does foo.pyd depend on (use DependencyWalker)?
Christoph _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
The .pyd file generated by f2py depends on the following
KERNEL32.DLL MSVCRT.DLL LIBGCC_S_DW2-1.DLL LIBGFORTRAN-3.DLL PYTHON27.DLL
It is possible that this is a mingw32 problem. I haven't been able to try using ifort/msvc.(mscv is somehow not getting installed on my system, but that's a separate issue).
Sameer
Can you try linking to the msvc9 runtime DLL? E.g.
f2py.py -c --fcompiler=gnu95 --compiler=mingw32 -lmsvcr90 -m foo foo.f
Christoph
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
That gives the same error as before. I was also trying to perform the compilation using the msvc compiler but am getting the these errors at the final linking stage. f2py.py -c --fcompiler=gnu95 --compiler=msvc -lmsvcr90 -m foo foo.f ->Cannot open input file 'msvcr90.lib' f2py.py -c --fcompiler=gnu95 --compiler=msvc -m foo foo.f ->Cannot open input file 'mingw32.lib' Where am I going wrong? Thanks for the help. Sameer
Excerpts from Sameer Grover's message of ven. mars 09 20:50:06 +0100 2012:
import gtk import foo # where foo is any f2py-wrapped program
Subsequently, on exiting python interpreter, the interpreter crashes with this error message - "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."
Strangely enough, interchanging the order of the import statements, i.e. importing the f2py wrapped program before gtk works fine. Furthermore, each module works fine individually.
This is a windows-only problem. I'm using Windows 7, Python 2.7, latest numpy, mingw32 compiler and the "pygtk all-in-one installer" (mentioned on the pygtk download page).
This happens even for very simple fortran programs such as this one - subroutine hello () write(*,*)'Hello from Fortran90!!!' end subroutine hello
I don't know whether the problem is with f2py or with gtk or with python but maybe somebody can shed some light on this.
Regards, Sameer Grover
Hi, I've had similar problem in the past (but on Gnu/Linux), which was solve to by setting the LC_ALL environnement variable to C. (never undersant why). (with Bash: export LC_ALL=C)
On 24 March 2012 13:28, David Froger <david.froger@gmail.com> wrote:
I've had similar problem in the past (but on Gnu/Linux), which was solve to by setting the LC_ALL environnement variable to C. (never undersant why). (with Bash: export LC_ALL=C)
This rings a bell. I have a feeling importing pygtk can change the Python default encoding (sys.getdefaultencoding()). That's never normally changed, so Python 2 code can assume it's always ascii. I guess pygtk sets the encoding from the system locale, so if it's set to C, it will use ascii, and the problem won't appear. Thomas
On Sat, Mar 24, 2012 at 8:09 AM, Thomas Kluyver <takowl@gmail.com> wrote:
On 24 March 2012 13:28, David Froger <david.froger@gmail.com> wrote:
I've had similar problem in the past (but on Gnu/Linux), which was solve to by setting the LC_ALL environnement variable to C. (never undersant why). (with Bash: export LC_ALL=C)
This rings a bell. I have a feeling importing pygtk can change the Python default encoding (sys.getdefaultencoding()). That's never normally changed, so Python 2 code can assume it's always ascii. I guess pygtk sets the encoding from the system locale, so if it's set to C, it will use ascii, and the problem won't appear.
That's interesting. I've noticed several different encodings used in numpy, 'ascii', 'latin1', and utf8. Might be worth taking a closer look at those cases. Chuck
participants (5)
-
Charles R Harris -
Christoph Gohlke -
David Froger -
Sameer Grover -
Thomas Kluyver