ActiveState Community

ActivePython 2.6 Pythonwin Crashes

Posted by j.m. on 2008-11-16 14:56

I've installed, repaired, uninstalled and reinstalled ActivePython 2.6 and am unable to run the PythonWin editor. It crashes with the following unhelpful message:

Pythonwin.exe has stopped working: A problem casued the program to stop working correctly. Windows will close the program and notify you if a solution is available.

The event log shows the following error:

Faulting application Pythonwin.exe, version 0.0.0.0, time stamp 0x4919d148, faulting module mfc90.dll, version 9.0.21022.8, time stamp 0x47316016, exception code 0xc0000005, fault offset 0x0004453f, process id 0x142c, application start time 0x01c94835143e1500

The cmd prompt interactive shell seems to work fine and PythonWin works fine with the also installed 2.5.2.2 version.

Any suggestions?

Thanks,
JM

trentm | Wed, 2008-11-19 15:06

"faulting module mfc90.dll"

Looks like you need to install the Visual Studio 2008 redistributable package. The ActivePython 2.6 installer *does* attempt to install the mfc90.dll if necessary, but it looks like there is some problem there.

I'm not sure what the root problem is. Perhaps your system already had an mfc90.dll so that the ActivePython 2.6 installer didn't think it needed to install one, then there was a version conflict.

A couple of Qs for you and then what should be a fix for your system:

1. Do you have an mfc90.dll under "C:\WINDOWS\System32" on your system?
2. Do you have an mfc90.dll under "C:\WINDOWS\WinSxS" on your system?
3. If you delete or move "*mfc*" in "C:\Python26\Lib\site-packages\pythonwin" (different base dir if you installed somewhere else) out of the way, does Pythonwin now startup?

A fix/workaround is to manually install the necessary redistributables from MS yourself:
http://www.microsoft.com/downloadS/details.aspx?familyid=9B2DA534-3E03-4...

j.m. | Thu, 2008-11-20 19:12

I did find mfc90.dll under "C:\WINDOWS\WinSxS" - so I removed the c:\python26 copies and reinstalled the redistributable. Am still getting the same results :(

Thanks for the info though - gives me something to investigate further.

trentm | Fri, 2008-11-21 10:45

> 3. If you delete or move "*mfc*" in "C:\Python26\Lib\site-packages\pythonwin" (different base dir if you installed somewhere else) out of the way, does Pythonwin now startup?

I'm very curious about the answer to this one.

j.m. | Fri, 2008-11-21 22:41

renamed and moved, still had the problem.

Tried to uninstall the redistributable, but the unintstall didn't remove the programs. Took a few tries to reinstall so that the redistributable install was whole again - but still no luck.

Tried switching out the mfc90.dll in the winsxs directory and no luck - they both (the one from activestate and from MS) show as being the samne version.

j.m. | Fri, 2008-11-21 23:47

so just to try something different, I logged in with a different user account and it works under the second account.

I can't see the difference, same OS instance, same install of pythonwin, same install of mfc. Both accounts have admin access. Same path for both. Both run pythwon win 2.5.2.2 just fine. One will run 2.6 and the other wont...

trentm | Mon, 2008-11-24 10:47

Perhaps some MFC90.dll in your user area? I don't know Vista that well. Is there a directory (it may be hidden) under C:\Users\$username\... that holds DLL files?

Are there any differences in the PATH variable for the two user accounts?

j.m. | Mon, 2008-11-24 22:36

Had the same suspicion.

I scoured the system for other copies of the DLL. Also validated which DLL was being used by renaming the winsxs one, causes a failed to initialize error. This happens for both user accounts. The path is the same for both accounts as well.

I also killed all services/processes that I could to try and eliminate potential conflicts.

Still hunting for the difference between the users.

thx

trentm | Tue, 2008-11-25 11:12

I wonder if it is a different DLL that is the problem then. I'm stumped.

Musing:
The ActivePython installer includes these redistributables:

# C Runtime:
Microsoft_VC90_CRT_x86.msm
policy_9_0_Microsoft_VC90_CRT_x86.msm
# MFC:
Microsoft_VC90_MFC_x86.msm
policy_9_0_Microsoft_VC90_MFC_x86.msm

However it doesn't include these:

Microsoft_VC90_MFCLOC_x86.msm
policy_9_0_Microsoft_VC90_MFCLOC_x86.msm

Perhaps they are necessary as well. The vcredist_x86.exe that you installed is meant to install all of these (in addition to a couple other packages labelled "ATL" and "OpenMP").

Possibly there is a problem with a conflict on the one user account on which you install ActivePython that is using the "MFC" package from the ActivePython installer, but some of the other packages (like the "MFCLOC") from the vcredict_x86.exe. That is a stretch, however. I don't have much reason to believe that.

hoozifachi_gmail | Thu, 2008-12-11 15:35

I am having the same issue on Windows Server 2003 Service Pack 2 with ActivePython-2.6.1.1.

I find the following error in the application event log:
Faulting application Pythonwin.exe, version 0.0.0.0, faulting module mfc90.dll, version 9.0.30411.0, fault address 0x0006ed13.

I do not have mfc90.dll under "C:\WINDOWS\System32", but I do have it under "C:\WINDOWS\WinSxS".

I removed the mfc* dlls from "C:\Python26\Lib\site-packages\pythonwin" and uninstalled/re-installed the VS 2008 redistributable.

The strange thing is that pythonwin was working just fine yesterday.

Has anyone found a solution to this problem?

Thanks,
Jason

j.m. | Thu, 2008-12-11 19:54

I've since loaded sysinternals process monitor and have run captures of working and non-working sessions but haven't had the time yet to analyze and determine the difference.

j.m. | Mon, 2008-12-15 21:42

Having run out of ideas, I changed the name of scintilla.dll to scintilla.dll.hold and ran Pythonwin.exe. It generated some errors, but didn't fail to open. It wouldn't open any files due to the lack of scintilla.dll.

However, when I subsequently renamed scintilla.dll.hold back to scintilla.dll - pythonwin started working again.

Go figure...

mtk | Wed, 2008-12-17 00:10

We have experienced similar problem while trying to get 2.6.x running on Vista machines.

After fresh intallation pythonwin starts up ok. One can open & close PythonWin several times without problems.

However, after you select Tools > Browse Python Path and then close PythonWin, the program fails to start up.

For every new user account the behaviour is similar, at first program runs ok but not after browsing the PythonPath.

Simple uninstalling+installing does not remove the problem, but if one deletes the Python-related registry entries for current user after uninstall, PythonWin starts again.

On failing startup PythonWin (2.6.1.1) gives the following info:

Problem signature:
Problem Event Name: APPCRASH
Application Name: Pythonwin.exe
Application Version: 0.0.0.0
Application Timestamp: 4939a87d
Fault Module Name: mfc90.dll
Fault Module Version: 9.0.21022.8
Fault Module Timestamp: 47316016
Exception Code: c0000005
Exception Offset: 0004453f
OS Version: 6.0.6001.2.1.0.256.4
Locale ID: 1035
Additional Information 1: 2795
Additional Information 2: e7b3c8fd00d80656b5c44506742e8ab9
Additional Information 3: 92f4
Additional Information 4: 877b55c7ae806e613e04d568a662cda7

j.m. | Wed, 2008-12-17 22:06

I can kill my pythonwin by using tools->browsepath and then fix it again by changing the name of scintilla.dll, running again, and then changing the name back again.

Michael Repucci | Sun, 2009-02-08 16:19

Renaming scintilla.dll regularly is a pretty inconvenient fix ... has anyone found a more permanent fix? I'm tempted just to use IDLE. Since the crash is due to mfc90.dll, is this perhaps related to the Python Win32 extensions?

In case it helps any of you whizzes out there ... I had a problem with this same DLL when trying to use MS Visual C++ 2008 with a toolkit called VRJuggler, which I think was actually due to its use of the Boost libraries. I couldn't compile any projects successfully for Debug, only for Release. I gave up trying to fix the problem when I learned this, figuring at least I'd ended up with the better of the two options, despite the obvious difficulties I had with debugging.

pyhis | Mon, 2009-02-16 08:10

I had similar problems, but they dissappeared after I expicitly set the administrative priviledges for executing the PythonWin editor. The error has been observed to appear if PythonPath is edited using the Tools menu, which could indicate there is a problem in checking priviledges before attempting to alter something. If there are no sufficient privileges to access or alter something, the system crashes.

It is probably not the idea to use PythonWin editor as administrator all the time? This is a major issue for scientific work, as in some institutes the use of administrative priviledges on ones workstation/laptop is not at all easily arranged.

These new problems may be connected to Vista operating system. It should be noted that so far I have not observed any problems executing the python codes, it seems just to be the editor.

PS This addition to priviledges seem to help for only one session of the editor: It might be that one should be logged in as user with administrative priviledges instead just assigning these priviledge requirements for execution in Vista (from /Properties/Shortcut/Advanced properties)

xunil1110 | Fri, 2009-02-20 05:19

We can download the latest file "scintilla.dll" from "www.dlldll.com/scintilla.dll_download.html" and update the old one which is in the same path as "pythonwin.exe".

sridharr | Mon, 2009-03-23 15:48

http://bugs.activestate.com/show_bug.cgi?id=82405

Does this workaround work for you all? If not, please let me know - sridharr(at)activestate.com.

--srid

ablo | Sun, 2009-05-17 08:59

Hi, srid
This dosen't work in Chinese Windows XP sp3.
I download the dll from www.dlldll.com/scintilla.dll_download.html and another site http://europe1.nodevice.com/downloads/31935e6c0d325723544fb2797022f724/2...

the dll are the same version 2.2.0.146. This version number is bigger than the pythonwin2.6 scintilla.dll version 1.7.5, but this dll is released on 2004.1.24, while the 1.7.5 version is release on 2009.4.21

the 2004 version will not make pythonwin crack, but it dosen't support Chinese any more!!!

So I replace it with the pythonwin2.5 packet scintilla.dll. It do support Chinese, and can run python script also. the pythonwin2.6 does not crack so frenquetly. But some time it will crack.