2
votes

so I'm trying to make an exe file. I'm using python 2.7, and from what I can tell, I have the correct version of py2exe installed. I've written a simple setup.py code to create the exe file.

However, when I run it, I get the error:

error: MSVCP90.dll: No such file or directory

Now, I have tried fixing this in two ways:

  1. I installed the MSVCP90.dll file and put it in with the python27 dll's, and then ran setup. This successfully created an executable. However, when I tried to run the executable, it said:

The program can't start because MSVCR90.dll is missing from your computer. Try reinstalling the program to fix this problem.

I've downloaded this dll and placed it in with python27, and with the exe to see what'd happen, but neither worked.

  1. I excluded the MSVCP90.dll file from being used in the setup file. Again, this successfully created an executable, but I ran into the same error when clicking on it.

I've reinstalled python and py2exe numerous times, and that didn't help.

Does anyone have any ideas for what I can do to get this executable working?

1
As a shotgun approach did you reboot after putting MSVCP90.dll in with the Python27 dlls?octopusgrabbus
Yes, I just tried that now, but it didn't solve anything.Ryan Anderson
I'm confused. Your error is for a different dll, 'R90.dll, but you're talking about 'P90.dll.octopusgrabbus
Yes, I know. I don't understand it, either!Ryan Anderson
Um, if it makes any difference, I am also using the wxpython libraries with my code.Ryan Anderson

1 Answers

0
votes

As you mentioned in the comments you are using wxpython. I had the same problem with wxpython and py2exe. I solved it by adding the manifest for MSVCP90.dll to exe file. Try to add these rows to setup.py and see if it works.

manifest = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
  />
  <description>%(prog)s</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
            level="asInvoker"
            uiAccess="false">
        </requestedExecutionLevel>
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
            type="win32"
            name="Microsoft.VC90.CRT"
            version="9.0.21022.8"
            processorArchitecture="x86"
            publicKeyToken="1fc8b3b9a1e18e3b">
      </assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
  </dependency>
</assembly>"""

...

windows = [{"script":"myscript.pyw",'other_resources': [(24,1,manifest)]}]