当我有 dll 时,Py2exe 抱怨缺少它们?

发布于 2024-12-02 04:32:31 字数 3724 浏览 7 评论 0原文

我在尝试使用 py2exe 将 python 程序构建到 Windows .exe 中时遇到错误,并且我的程序未构建。它说我缺少一些模块,例如 numpy 模块。我确定 numpy 安装正确。为什么它说我缺少模块?我该如何解决这个问题?

*** copy dlls ***
copying C:\Python27\lib\site-packages\py2exe\run.exe -> C:\Users\jchan1\Desktop\copdata\dist\dplotNew.exe
The following modules appear to be missing
['Carbon', 'Carbon.Files', 'Image', 'Numeric', 'Pyrex.Compiler.Main', '__svn_version__', 
'_curses', '_scproxy', '_transforms', 'configparser', 'copyreg', 'core.abs', 'core.max',
 'core.min', 'core.round', 'fcompiler.FCompiler', 'fcompiler.show_fcompilers', 'gobject', 
'mpl_toolkits.natgrid', 'nose', 'nose.plugins', 'nose.plugins.base', 'nose.plugins.builtin',
 'nose.plugins.errorclass', 'nose.plugins.manager', 'nose.tools', 'nose.util', 'numarray', 
'numpy_distutils', 'numpy_distutils.command.build_flib', 'numpy_distutils.command.cpuinfo', 
'numpy_distutils.cpuinfo', 'numpy_distutils.fcompiler', 'numscons', 'numscons.core.utils', 
'pkg_resources', 'projections.get_projection_class', 'projections.get_projection_names', 
'projections.projection_factory', 'pyemf', 'qt', 'scipy', 'setuptools', 'setuptools.command', 
'setuptools.command.bdist_rpm', 'setuptools.command.develop', 'setuptools.command.egg_info', 
'setuptools.command.install', 'setuptools.command.sdist', 'sitecustomize', 'testing.Tester', 
'usercustomize', 'win32api', 'win32con', 'win32pdh', 'win32pipe', 'wx', 'numpy.absolute', 
'numpy.arccos', 'numpy.arccosh', 'numpy.arcsin', 'numpy.arcsinh', 'numpy.arctan', 'numpy.arctanh', 
'numpy.bitwise_and', 'numpy.bitwise_or', 'numpy.bitwise_xor', 'numpy.bool_', 'numpy.ceil', 
'numpy.conjugate', 'numpy.core.absolute', 'numpy.core.add', 'numpy.core.cdouble', 
'numpy.core.complexfloating', 'numpy.core.conjugate', 'numpy.core.csingle', 'numpy.core.double', 
'numpy.core.exp', 'numpy.core.float64', 'numpy.core.float_', 'numpy.core.inexact', 
'numpy.core.intc', 'numpy.core.integer', 'numpy.core.isfinite', 'numpy.core.isinf', 
'numpy.core.isnan', 'numpy.core.log', 'numpy.core.maximum', 'numpy.core.multiply', 
'numpy.core.number', 'numpy.core.signbit', 'numpy.core.single', 'numpy.core.sqrt', 'numpy.cosh',
 'numpy.divide', 'numpy.e', 'numpy.fabs', 'numpy.floor', 'numpy.floor_divide', 'numpy.fmod', 
'numpy.greater', 'numpy.hypot', 'numpy.invert', 'numpy.isinf', 'numpy.left_shift', 'numpy.less', 
'numpy.log', 'numpy.logical_and', 'numpy.logical_not', 'numpy.logical_or', 'numpy.logical_xor', 
'numpy.maximum', 'numpy.minimum', 'numpy.negative', 'numpy.not_equal', 'numpy.power', 
'numpy.remainder', 'numpy.right_shift', 'numpy.sign', 'numpy.sinh', 'numpy.tan', 'numpy.tanh', 
'numpy.true_divide']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   IMM32.dll - C:\WINDOWS\system32\IMM32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   ole32.dll - C:\WINDOWS\system32\ole32.dll
   WINMM.dll - C:\WINDOWS\system32\WINMM.dll
   fftpack_lite.pyd - C:\Python27\lib\site-packages\numpy\fft\fftpack_lite.pyd
   COMDLG32.dll - C:\WINDOWS\system32\COMDLG32.dll
   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   msvcrt.dll - C:\WINDOWS\system32\msvcrt.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   WINSPOOL.DRV - C:\WINDOWS\system32\WINSPOOL.DRV
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   MSVCP90.dll - C:\Python27\DLLs\MSVCP90.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   COMCTL32.dll - C:\WINDOWS\system32\COMCTL32.dll

I'm getting an error when trying to build a python program into a Windows .exe using py2exe, and my program is not built. It says that I am missing some modules, such as numpy ones. I'm sure numpy is installed correctly. Why does it say that I have missing modules? How do I fix this?

*** copy dlls ***
copying C:\Python27\lib\site-packages\py2exe\run.exe -> C:\Users\jchan1\Desktop\copdata\dist\dplotNew.exe
The following modules appear to be missing
['Carbon', 'Carbon.Files', 'Image', 'Numeric', 'Pyrex.Compiler.Main', '__svn_version__', 
'_curses', '_scproxy', '_transforms', 'configparser', 'copyreg', 'core.abs', 'core.max',
 'core.min', 'core.round', 'fcompiler.FCompiler', 'fcompiler.show_fcompilers', 'gobject', 
'mpl_toolkits.natgrid', 'nose', 'nose.plugins', 'nose.plugins.base', 'nose.plugins.builtin',
 'nose.plugins.errorclass', 'nose.plugins.manager', 'nose.tools', 'nose.util', 'numarray', 
'numpy_distutils', 'numpy_distutils.command.build_flib', 'numpy_distutils.command.cpuinfo', 
'numpy_distutils.cpuinfo', 'numpy_distutils.fcompiler', 'numscons', 'numscons.core.utils', 
'pkg_resources', 'projections.get_projection_class', 'projections.get_projection_names', 
'projections.projection_factory', 'pyemf', 'qt', 'scipy', 'setuptools', 'setuptools.command', 
'setuptools.command.bdist_rpm', 'setuptools.command.develop', 'setuptools.command.egg_info', 
'setuptools.command.install', 'setuptools.command.sdist', 'sitecustomize', 'testing.Tester', 
'usercustomize', 'win32api', 'win32con', 'win32pdh', 'win32pipe', 'wx', 'numpy.absolute', 
'numpy.arccos', 'numpy.arccosh', 'numpy.arcsin', 'numpy.arcsinh', 'numpy.arctan', 'numpy.arctanh', 
'numpy.bitwise_and', 'numpy.bitwise_or', 'numpy.bitwise_xor', 'numpy.bool_', 'numpy.ceil', 
'numpy.conjugate', 'numpy.core.absolute', 'numpy.core.add', 'numpy.core.cdouble', 
'numpy.core.complexfloating', 'numpy.core.conjugate', 'numpy.core.csingle', 'numpy.core.double', 
'numpy.core.exp', 'numpy.core.float64', 'numpy.core.float_', 'numpy.core.inexact', 
'numpy.core.intc', 'numpy.core.integer', 'numpy.core.isfinite', 'numpy.core.isinf', 
'numpy.core.isnan', 'numpy.core.log', 'numpy.core.maximum', 'numpy.core.multiply', 
'numpy.core.number', 'numpy.core.signbit', 'numpy.core.single', 'numpy.core.sqrt', 'numpy.cosh',
 'numpy.divide', 'numpy.e', 'numpy.fabs', 'numpy.floor', 'numpy.floor_divide', 'numpy.fmod', 
'numpy.greater', 'numpy.hypot', 'numpy.invert', 'numpy.isinf', 'numpy.left_shift', 'numpy.less', 
'numpy.log', 'numpy.logical_and', 'numpy.logical_not', 'numpy.logical_or', 'numpy.logical_xor', 
'numpy.maximum', 'numpy.minimum', 'numpy.negative', 'numpy.not_equal', 'numpy.power', 
'numpy.remainder', 'numpy.right_shift', 'numpy.sign', 'numpy.sinh', 'numpy.tan', 'numpy.tanh', 
'numpy.true_divide']

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   OLEAUT32.dll - C:\WINDOWS\system32\OLEAUT32.dll
   USER32.dll - C:\WINDOWS\system32\USER32.dll
   IMM32.dll - C:\WINDOWS\system32\IMM32.dll
   SHELL32.dll - C:\WINDOWS\system32\SHELL32.dll
   ole32.dll - C:\WINDOWS\system32\ole32.dll
   WINMM.dll - C:\WINDOWS\system32\WINMM.dll
   fftpack_lite.pyd - C:\Python27\lib\site-packages\numpy\fft\fftpack_lite.pyd
   COMDLG32.dll - C:\WINDOWS\system32\COMDLG32.dll
   ADVAPI32.dll - C:\WINDOWS\system32\ADVAPI32.dll
   msvcrt.dll - C:\WINDOWS\system32\msvcrt.dll
   WS2_32.dll - C:\WINDOWS\system32\WS2_32.dll
   WINSPOOL.DRV - C:\WINDOWS\system32\WINSPOOL.DRV
   GDI32.dll - C:\WINDOWS\system32\GDI32.dll
   MSVCP90.dll - C:\Python27\DLLs\MSVCP90.dll
   KERNEL32.dll - C:\WINDOWS\system32\KERNEL32.dll
   COMCTL32.dll - C:\WINDOWS\system32\COMCTL32.dll

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆悲凉 2024-12-09 04:32:31

尝试将 DLL 放入 Windows 文件夹中。还将所需的模块复制到与您尝试转换为 exe 的 Python 文件之一相同的文件夹中。

Try putting the DLLs in the Windows folder. Also copy the needed modules to the same folder as the one of the Python file you're trying to convert into exe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文