py2exe生成的exe给出psutil ImportError:DLL加载失败错误

时间:2016-12-22 17:09:19

标签: python py2exe psutil

我正在尝试使用py2exe工具生成一个Windows7 64位可执行文件。(Python解释器版本是2.7.8 x64)这是我的python脚本:

import psutil

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

这是我的setup.py文件:

from distutils.core import setup
import py2exe

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

每当我尝试在Windows7(x64)环境中运行生成的test.exe时,我从命令行收到以下错误:

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. 

有关如何解决此问题的任何想法?注意我检查了相关帖子哪些建议包括&#34; dll_excludes&#34;在py2exe安装选项中,但它无法正常工作。

0 个答案:

没有答案
相关问题