Python 转换为.exe后出现Tweepy错误

Python 转换为.exe后出现Tweepy错误,python,python-2.7,tkinter,py2exe,tweepy,Python,Python 2.7,Tkinter,Py2exe,Tweepy,所以我刚刚用python编写完这个tkinter程序,一切都很完美,没有错误,但当我将它转换为.exe时,我得到了以下错误: File "tweepy\binder.pyc", line 239, in _call File "tweepy\binder.pyc", line 189, in execute tweepy.error.TweepError: Failed to send request: [Errno 2] No such file or directory 在

所以我刚刚用python编写完这个tkinter程序,一切都很完美,没有错误,但当我将它转换为.exe时,我得到了以下错误:

  File "tweepy\binder.pyc", line 239, in _call
  File "tweepy\binder.pyc", line 189, in execute
  tweepy.error.TweepError: Failed to send request: [Errno 2] No such   file or directory
在.py中一切正常,没有错误发生,我在互联网上找不到任何解决方案。请有人帮忙。
有人能帮我吗?我还没有找到任何答案

好吧,我终于解决了自己的问题这是我自己找到的唯一解决方案,可能不是最好的,但它很有效,所以我将一步一步地解释它,这样其他有同样问题的人就不必经历我经历过的事情: 转到tweepy文件夹并查找binder.py打开它并在其中查找:

try:
     resp = self.session.request(self.method,
                                 full_url,
                                 data=self.post_data,
                                 timeout=self.api.timeout,
                                 auth=auth,
                                 proxies=self.api.proxy,
                                 )
然后在末尾添加verify='cacert.pem',如下所示:

try:
     resp = self.session.request(self.method,
                                 full_url,
                                 data=self.post_data,
                                 timeout=self.api.timeout,
                                 auth=auth,
                                 proxies=self.api.proxy,
                                 verify='cacert.pem')
保存它,现在还需要修改binder.pyc,因为py2exe在编译时使用它来创建新脚本并在其中键入:

import py_compile

py_compile.compile('path_to_binder.py')
(最好在进行任何修改之前备份binder.py和binder.pyc)

现在将脚本和binder.py(modded one)放在同一个文件夹中(脚本中的路径必须指向此文件夹中的binder.py),然后运行脚本

将生成的binder.pyc放入存放旧binder.pyc的tweepy文件夹中


现在,像您希望的那样运行py2exe,完成后找到“cacert.pem”并将其放在.exe所在的“dist”文件夹中,运行.exe,所有操作都将正常运行。

如果您在该网站上搜索“185090050”,会有很多答案。你把它们都读了,看它们是否有用吗?是的,我看了它们,试了很多次,但都没有working@BryanOakley你能帮我吗?我什么都做不了