0

Hi,
i creates this program:

import wmi

c = wmi.WMI()
for i in c.Win32_Processor ():
    cputype = i.Name
print cputype

for i in c.Win32_ComputerSystem():
    mem = int(i.TotalPhysicalMemory)

print mem/1000000, "mb"

I make exe file with py2exe.
When i run program, i see this error:

D:\py\dist>cpu.exe
Traceback (most recent call last):
  File "cpu.py", line 1, in <module>
  File "zipextimporter.pyc", line 82, in load_module
  File "wmi.pyc", line 88, in <module>
  File "zipextimporter.pyc", line 82, in load_module
  File "win32com\__init__.pyc", line 5, in <module>
  File "zipextimporter.pyc", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32api.pyd

What wrong?

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Lolalola
0

Compile code:

#!/usr/bin/env python
from distutils.core import setup
import py2exe

setup(
    console=["cpu.py"],
    zipfile=None
)

Program code:

import wmi

c = wmi.WMI()
for i in c.Win32_Processor ():
    cputype = i.Name
print cputype

for i in c.Win32_ComputerSystem():
    mem = int(i.TotalPhysicalMemory)

print mem/1000000, "mb"

I have to install Pywin32.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.