Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#109 py2exe not working on py2.6 due to missing MSVCP90.dll

open
nobody
None
5
2008-11-19
2008-11-19
vbr
No

First, I'm not sure whether the mentioned issue is a problem with py2exe, but I simply came acros it while trying py2exe 0.6.9 with pyton 2.6.

After installing py2exe for python 2.6 and simply trying the script (a wx app) and its setup script (working ok using py2exe on py 2.5) I got the error while converting to exe.

*** finding dlls needed ***
error: MSVCP90.dll: No such file or directory

Strangely (for me) in python26 directory (installed using the standard windows installer form python.org) there is only msvcr71.dll from this category (possibly added by wxpython install?).

After I copied the mentioned missing file from
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_ ... \msvcp90.dll

to the python26 directory (where the setup script is also run from), the compilation runs ok, and the resulting exe in the dist folder works ok on that computer. (for some machines I also had to copy some redistributables to the app folder in order to get it work)

The computers I tried are running WinXPh or XPp with SP3;
the python version is 2.6, other involved libraries besides py2exe 0.6.9 is maybe wxPython unicode 2.8.9.1 for py26.

I found some references regarding problems with redistributables e.g.

http://bugs.python.org/issue4120
http://lists.wxwidgets.org/pipermail/wxpython-users/2008-November/081956.html

but it's not quite clear to me, what the deployment using an exe should look like in order to be reasonably sure, that the app will work regardles of the particular computer setup.

I also don't think it should be a standard approach to just copy the missing files from anywhere on the drive, where they happen to be found.

Is there some problem in py2exe or somewhere else in python in this regard, or am I doing something wrong, which first started to matter in python 2.6?

If I missed some relevant informations, please let me know.

regards
Vlastimil Brom

Discussion

  • Jordan
    Jordan
    2008-12-08

    I've been having a similar issue with Python2.6 and py2exe. My compiled executables work fine on the machine that they were compiled on. But after transferring the .exe to another machine without Python2.6, I get an error saying that the application's configuration is incorrect. I used Dependency Walker to find some .dlls that were missing, downloaded them into the working directory but to no success. I still get the same error. I then decided to try and compile the files with Python2.5 and py2exe. The resulting executables work great on both machines with and without Python. So there is a problem somewhere in Python2.6 or py2exe's version for Python2.6.

     
  • the bug is still available. ping!

     
  • David Eaton
    David Eaton
    2009-03-11

    I am having the exact Issue. I am using windows Vista SP1 and I regularly update my windows platform.

    I can compile my program using py2exe using this configuration.
    python-2.5.4.msi
    wxPython2.8-win32-unicode-2.8.9.2-py25.exe
    py2exe-0.6.9.win32-py2.5.exe

    And everything works fine, I can run and compile my program into a nice exe.

    but when I tried to upgrade using this configuration
    python-2.6.1.msi
    wxPython2.8-win32-unicode-2.8.9.2-py26.exe
    py2exe-0.6.9.win32-py2.6.exe

    I get alot of problems.

    1. My ToolBar does is not using the themes anymore while my menu bar is. I even applied the update_manifest.py fix. I will show you my setup.py at the bottom of this comment. I have even applied the manifest fix in the setup.py. It fixes it in the 2.5.x version but I am having different issues on 2.6.x but nearly the same problem.

    2. When I compile using py2exe I get the following.

    Microsoft Windows [Version 6.0.6001]
    Copyright (c) 2006 Microsoft Corporation. All rights reserved.

    C:\Users\dae>cd C:\Users\dae\Desktop\RK_Python\RK3

    C:\Users\dae\Desktop\RK_Python\RK3>path=C:\Python26

    C:\Users\dae\Desktop\RK_Python\RK3>python setup26.py py2exe

    C:\Users\dae\Desktop\RK_Python\RK3>

    c:\python26\lib\site-packages\py2exe\build_exe.py:16: Deprecation Warning: the sets module is deprecated
    import sets
    running py2exe
    *** searching for required modules ***
    *** parsing results ***
    **[SNIP SNIP for Readability]***

    *** finding dlls needed ***
    error: MSVCP90.dll: No such file or director

    I tried researching it on the google and I found this package http://support.microsoft.com/kb/956414 has the MSVCP90.dll and you can download it here ( http://www.microsoft.com/downloads/thankyou.aspx?familyId=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displayLang=en ) Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

    I even tried and Installed these:

    Microsoft Visual C++ 2005 Redistributable Package (x86)
    http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en

    Microsoft Visual C++ 2008 Redistributable Package (x86)
    http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

    Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
    http://www.microsoft.com/downloads/thankyou.aspx?familyId=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displayLang=en

    That was suppose to help, but it still does not work. it will not even let me compile, it gets to the error and closes the black screen. I have tried restarting the computer after I ran each Microsoft installer

    I tried to download just that one dll (msvcp90.dll) http://www.dll-files.com/dllindex/dll-files.shtml?msvcp90 from a third party site. and place it in the "C:\Windows\System32\" folder and register that .dll

    Open up your CMD window (the black screen) and type this "regsvr32 C:\Windows\System32\msvcp90.dll"

    but it would not register correctly on Vista.. Maybe there's more needed to get this .dll to work correctly.

    I can't seem to figure this out.. Here are some more threads on the same topic

    http://www.nabble.com/py2exe,-Py26,-wxPython-and-dll-td20556399.html
    http://forum.i2p2.de/viewtopic.php?t=2934&sid=f11e857d17f63bd2de5d8d6bd63c1062
    http://forum.i2p2.de/viewtopic.php?t=2934&postdays=0&postorder=asc&start=30
    http://merapi.dyndns.org/abc/ABC380_OKC_test0368.txt

    So I guess I am just stuck reverting back to Python 2.5.4 since it's the most stable with Py2exe. I would love to find a fix that actually works.

    Here is my setup26.py

    #-----------------------------------------------------------------------
    # Start File
    #-----------------------------------------------------------------------
    from distutils.core import setup
    import py2exe,sys,os

    manifest = """
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
    manifestVersion="1.0">
    <assemblyIdentity
    version="0.64.1.0"
    processorArchitecture="x86"
    name="Controls"
    type="win32"
    />
    <description>myProgram</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
    type="win32"
    name="Microsoft.Windows.Common-Controls"
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
    />
    </dependentAssembly>
    </dependency>
    </assembly>
    """

    """
    installs manifest and icon into the .exe
    but icon is still needed as we open it
    for the window icon (not just the .exe)
    changelog and logo are included in dist
    """

    """
    # I can use this to fool py2exe! Docs - http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls
    origIsSystemDLL = py2exe.build_exe.isSystemDLL
    def isSystemDLL(pathname):
    if os.path.basename(pathname).lower() in ("msvcp90.dll", "gdiplus.dll"):
    return 0
    return origIsSystemDLL(pathname)
    py2exe.build_exe.isSystemDLL = isSystemDLL
    """

    setup(
    name="Referral Keeper",
    version ="3.0.0",
    description ="Referral Keeper - Referral Traffic Machine",
    author="David A Eaton",
    author_email="support@phprocket.com",
    url="http://www.referralkeeper.com",
    windows = [
    {
    "script":
    "RK3.py", ### Main Python script
    "icon_resources":
    [(0, "myicon.ico")], ### Icon to embed into the PE file. It's in the same folder as this script.
    "other_resources":
    [(24,1,manifest)], #Stops weird Compile Errors with toolbar images, ect. works great on python 2.5.4 not sure on 2.6.1
    }
    ],

    options={
    "py2exe":{
    "unbuffered": True,
    "optimize": 2
    }
    }
    )

    input("<Click Enter to Exit>")

    #-----------------------------------------------------------------------
    # End File
    #-----------------------------------------------------------------------

     
  • I confirm this bug with py2exe-python2.6

     
  • I also confirm this bug. I have been waiting a long time for a solution.

     
  • Same here, I encountered the same problem. But the hack-ish solution I've been working with us to put the dependent files into my application folder using the py2exe script by using the "data_files" option:-

    data_files = [
    (
    '',
    [
    'DLLs/msvcm90.dll',
    'DLLs/msvcp90.dll',
    'DLLs/msvcr90.dll',
    'DLLs/Microsoft.VC90.CRT.manifest',
    ],
    ),
    ],

    This assuming of course that you have a folder called DLLs in your current working path with all those 4 files. It seems to work for now...

     
  • -1'

     
  • -1'