py2exe generated exe gives psutil ImportError: DLL load failed error

267 views Asked by At

I am trying to generate a Windows7 64bit executable using py2exe tool.(Python interpreter version is 2.7.8 x64) Here is my python script:

import psutil

for p in psutil.process_iter():
print(p)

And here is my setup.py file :

from distutils.core import setup
import py2exe

setup(console=['test.py'])

Whenever I try to run generated test.exe in Windows7(x64) environment I get the following error from command line:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
  File "psutil\__init__.pyc", line 126, in <module>
  File "psutil\_pswindows.pyc", line 16, in <module>
  File "psutil\_psutil_windows.pyc", line 12, in <module>
  File "psutil\_psutil_windows.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found. 

Any ideas about how to fix this ? Note I checked the related posts which advice to include "dll_excludes" in py2exe setup options, but it is not working.

0

There are 0 answers