MSVCR80.dll 上的 py2exe 错误

发布于 2024-09-15 21:42:13 字数 1917 浏览 4 评论 0原文

from distutils.core import setup
import py2exe,sys,os

sys.argv.append('py2exe')

try:
        setup(
   options = {'py2exe': {'bundle_files': 1}}, 
   console=['my_console_script.py'], 
   zipfile = None,
   )
except Exception, e:
 print e

输出:

> running py2exe
> *** searching for required modules ***
> *** parsing results ***
> *** finding dlls needed *** Traceback (most recent call last):   File
> "C:\scripts\download_ghost_recon\setup.py",
> line 26, in <module>
>     zipfile = None,   File "C:\Python26\lib\distutils\core.py",
> line 162, in setup
>     raise SystemExit, error SystemExit: error: MSVCR80.dll: No
> such file or directory

我在 Windows 7 中使用 python 2.6

那么我怎样才能让这个 MSVCR80.dll 错误消失并编译我的脚本呢?

在其他脚本上,我可以运行相同的 setup.py 而不会收到此错误。

这让我认为在这个脚本中,py2exe需要这个MSVCR80.dll

我也尝试了这个代码,我在这里找到了: 但它也不起作用。

from distutils.core import setup
import py2exe,sys,os

origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
        if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
                return 0
        return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

sys.argv.append('py2exe')

try:
        setup(
            options = {'py2exe': {'bundle_files': 1}}, 
            console=['my_console_script.py'], 
            zipfile = None,
            )
except Exception, e:
    print e

*编辑 我还在我的计算机上搜索了该文件,可以在以下位置找到它:

C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8
C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d
C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5
from distutils.core import setup
import py2exe,sys,os

sys.argv.append('py2exe')

try:
        setup(
   options = {'py2exe': {'bundle_files': 1}}, 
   console=['my_console_script.py'], 
   zipfile = None,
   )
except Exception, e:
 print e

outputs:

> running py2exe
> *** searching for required modules ***
> *** parsing results ***
> *** finding dlls needed *** Traceback (most recent call last):   File
> "C:\scripts\download_ghost_recon\setup.py",
> line 26, in <module>
>     zipfile = None,   File "C:\Python26\lib\distutils\core.py",
> line 162, in setup
>     raise SystemExit, error SystemExit: error: MSVCR80.dll: No
> such file or directory

I'm on python 2.6 in Windows 7

So how can I make this MSVCR80.dll error go away, and compile my script?

On other scripts, I can run the same setup.py and not receive this error.

This makes me think that in this script, py2exe needs this MSVCR80.dll

I also tried this code, which I found here:
http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls
but it also didn't work.

from distutils.core import setup
import py2exe,sys,os

origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
        if os.path.basename(pathname).lower() in ("msvcp71.dll", "dwmapi.dll"):
                return 0
        return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

sys.argv.append('py2exe')

try:
        setup(
            options = {'py2exe': {'bundle_files': 1}}, 
            console=['my_console_script.py'], 
            zipfile = None,
            )
except Exception, e:
    print e

*EDIT
I've also run a search on my computer for this file, it is found in these locations:

C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8
C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_none_d08d7da0442a985d
C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5

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

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

发布评论

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

评论(1

宁愿没拥抱 2024-09-22 21:42:13

附加到对 setup 的调用:

{ 'py2exe': { ...,
              'dll_excludes': [ 'msvcr80.dll', 'msvcp80.dll',
                                'msvcr80d.dll', 'msvcp80d.dll',
                                'powrprof.dll', 'mswsock.dll' ] }, ...

如果您想在应用程序中包含 Visual C 运行时 DLL,请查看 Microsoft 的可分发运行时下载。您可能正在使用在此应用程序中导入的库或模块,但不是您所说的其他库或模块。检查是否可以使用 Visual Studio 2008 重新编译它们可能是个好主意,因为这是用于创建标准 Python 2.6 Windows 版本的工具。

Append to your call to setup:

{ 'py2exe': { ...,
              'dll_excludes': [ 'msvcr80.dll', 'msvcp80.dll',
                                'msvcr80d.dll', 'msvcp80d.dll',
                                'powrprof.dll', 'mswsock.dll' ] }, ...

If you want to include the visual C runtime DLLs in your application, have a look at Microsoft's distributable runtime downloads. Probably you're using a library or module that is imported in this application, but not the others you speak of. It may be a good idea to check if you can recompile them using Visual Studio 2008, because that's what is used to create the standard Python 2.6 Windows builds.

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