“ Windows错误:提供程序DLL无法正确初始化”。在冻结的wxpython应用程序中导入cgi模块 [英] "Windows Error: provider DLL failed to initialize correctly" on import of cgi module in frozen wxpython app

查看:164
本文介绍了“ Windows错误:提供程序DLL无法正确初始化”。在冻结的wxpython应用程序中导入cgi模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个冻结的wxpython应用程序的用户,该用户获取了所附的屏幕截图。

I have a user of a frozen wxpython app that gets the appended screenshot.

错误消息是 Windows错误:提供程序DLL无法正确初始化

The error message is "Windows Error: provider DLL failed to initialize correctly"

暂停的视频是我可以从他们那里获得此错误消息的唯一方法,因为整个事件会立即消失(包括创建用于捕获stderr的DOS窗口,此消息出现在其中)。

A screenshot taken from a paused video is the only way I could get this error message from them because the whole thing disappears instantly (including this DOS window created to capture stderr, where this message is appearing). IE python is dieing before it even really gets going.

回溯指向我在controller.py第14行的代码。

The traceback points to my code at controller.py line 14.

此行是

导入cgi

由于某种原因,似乎cgi在导入期间正在调用随机(为什么会这样?),并且由于某种原因,由于某些DLL原因,此操作失败。

For some reason, it seems that cgi is calling random during import (why would that be?) and for some reason this is failing for some DLL reason.

任何提示?

注1:此应用程序可用于数百个其他Windows和Mac用户。因此,就好像我出于某种原因不提供仅此用户机器上没有的东西。

Note 1: this app works fine for hundreds of other Windows and Mac users. So it's as if I'm not supplying something that is not on only this user's machine for some reason.

注2:可执行文件是使用bbfreeze创建的,其内容如下配置:

Note 2: the executable is created using bbfreeze, with the following config:

 f = Freezer(distdir = distdir,
            includes = ['wx.lib.pubsub.core.kwargs.*',
                        'wx.lib.pubsub.core.*',
                        'dbhash',
                        'platform']
            )

我不确定我还要在这里放什么。 ‘cgi’? 随机?

I'm not sure what else I'd put in here. 'cgi'? 'random'?

推荐答案

对我来说,确切的错误消息是:

For me, the exact error message was:

WindowsError:[错误- 2146893795]提供程序DLL无法正确初始化

WindowsError: [Error -2146893795] Provider DLL failed to initialize correctly

,带有如下跟踪:

  File "C:\Dev\Python\python-2.7.11\lib\tempfile.py", line 35, in <module>
    from random import Random as _Random
  File "C:\Dev\Python\python-2.7.11\lib\random.py", line 885, in <module>
    _inst = Random()
  File "C:\Dev\Python\python-2.7.11\lib\random.py", line 97, in __init__
    self.seed(x)
  File "C:\Dev\Python\python-2.7.11\lib\random.py", line 113, in seed
    a = long(_hexlify(_urandom(2500)), 16)
WindowsError: [Error -2146893795] Provider DLL failed to initialize correctly

为我解决的是来自 http://bugs.python.org/issue1384175 的评论a>( http://bugs.python.org/msg248947 )表示以下内容:

And what solved it for me was a comment from http://bugs.python.org/issue1384175 (http://bugs.python.org/msg248947), saying the following:

This happened at a call to `os.urandom` for me.
This was in a subprocess.

The bug for me was that I called `_subprocess.CreateProcess` 
with an `env_mapper = {'foo': 'bar'}`. The fix:

    env_mapper = os.environ.copy()
    env_mapper.update({'foo': 'bar'})

这篇关于“ Windows错误:提供程序DLL无法正确初始化”。在冻结的wxpython应用程序中导入cgi模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆