python py2exe: exe creation/errors

python py2exe: exe creation/errors

我正在尝试使用 tkinter 为 python 程序创建 windows 可执行文件。这本质上是一个使用请求模块的网络爬虫。我不确定从哪里开始解决我的问题。我能够创建 exe 并 运行 它。我的程序有一个登录视图,当提交并发出请求时,就会出现错误。你需要使用 VPN 来发出这些请求,所以我还没有在这里发布我的所有代码。如果需要任何其他 info/code,请告诉我。以下错误仅在 运行 运行 exe 时出现,而不是原始 python 文件。这是错误:

Exception in Tkinter callback
Traceback (most recent call last):
  File "Tkinter.pyc", line 1486, in __call__
  File "Dest_gui.py", line 222, in login_gui
  File "Dest_gui.py", line 29, in login
  File "requests\sessions.pyc", line 498, in post
  File "requests\sessions.pyc", line 456, in request
  File "requests\sessions.pyc", line 559, in send
  File "requests\adapters.pyc", line 382, in send
SSLError: [Errno 185090050] _ssl.c:344: error:0B084002:x509 certificate      routines
:X509_load_cert_crl_file:system lib

我无法使用 py2exe 进行此操作,但使用 pyinstaller. You just need to have pywin32 也可以正常工作。