473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help: Runtime Error when loading ".pyd" module

Hi There,

We are extending Python interpreter to support special functions of our
tools. What we did is to compile Python's source code (which is got from the
an installation on a Linux environment for Python 2.3.3) and our extensions
(C++ code) on Windows with Microsoft Visual C++ 6.0 compiler to generate the
extended Python interpreter.

It works well on Linux and for the basic Python modules and our special
modules on Windows. But whenever a ".pyd" module is loaded by a statement
like the following:
import socket; # which finally calls: import _socket
or
import Tkinter; # which finally calls: import _tkinter
or
import datetime
it hits a "Runtime Error" (which is shown in a message box saying "abnormal
program termination") and a message like the following is printed in the
console:
Fatal Python error: Interpreter not initialized (version mismatch?)
I tried to use Microsoft Visual Studio to debug the program and set a
breakpoint at "Py_FatalError()", but the breakpoint is not hit. I also
traced the loading process of the ".pyd" file in function
"_PyImport_LoadDynamicModule()": the ".pyd" file is correctly located and
loaded, and its "init" function seems be got correctly, but when the
initialization function is called, the above error happens.

I am pretty sure that Python is initialized by "Py_Initialize()", and the
".pyd" files are from the standard Python installation with the same version
(2.3.3).

Does anyone have any idea about the crash? Does the initialization function
from a ".pyd" file require special environment?

Because the ".pyd" files (like "_socket.pyd", _tkinter.pyd" and
"datetime.pyd" etc) are precompiled and contained in the Python installer
for Windows, I don't know how to manually compile them and debug them.

I appreciate your help in advance.

-Terry
Mar 2 '06 #1
0 1795

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
1
by: Nick | last post by:
How to change the pic to a "show error" image when loading images failed - for example, no image file exists? I tried to add the following statement in the onload event function: if...
0
by: Neal | last post by:
Hi I am trying to use a 3rd party DLL in my app, (WebService and/or WebApp) I set the references to it, use its public functions and properties OK in Dev mode but when I run it, i get the...
1
by: AA Arens | last post by:
To have the first character of a fiels capitalized AfterUppdate, I used the following script: Me!City = UCase$(Left$(Me!City, 1)) + Mid$(Me!City, 2) UCase (Left(Me!City, 1)) + Mid(Me!City, 2) ...
18
by: Microsoft | last post by:
When I try this in my code I alwas get an errormessage: "Object reference not set to an instance of an object" Dim g As System.Drawing.Graphics g.DrawString("Test", New Font("Arial", 12,...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
10
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred."...
0
by: John [H2O] | last post by:
Hello, I have a module created from a Fortran file to read in unformatted binary fortran output. It works fine for some datasets, but crashes with others. The strange thing is it will loop...
0
by: John [H2O] | last post by:
There's a lot of greek for me here ... should I post to numpy-discussions as well??? The backtrace is at the bottom.... Thanks! GNU gdb Fedora (6.8-21.fc9) Copyright (C) 2008 Free...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.