我制作了一个python脚本,我必须从中构建一个.exe文件。首先我尝试了py2exe,但是我收到了这个错误
Exception: Could not find config file in any of: [u'D:\\...path...\\dist\\library.zip\\praw\\praw.ini', u'C:\\Users\\User\\AppData\\Roaming\\praw.ini', u'praw.ini']
将praw.ini添加到.exe文件夹可以解决问题但我必须将htmlentitydefs.pyc添加到py2exe生成的library.zip中:
File "praw\__init__.pyc", line 46, in <module>
File "six.pyc", line 203, in load_module
File "six.pyc", line 115, in _resolve
File "six.pyc", line 82, in _import_module
ImportError: No module named htmlentitydefs
最后我的.exe可以启动并执行但是在插入登录凭据(由r.login()PRAW方法处理)之后我得到了:
File "<decorator-gen-51>", line 2, in login
File "praw\decorators.pyc", line 78, in wrap
File "praw\__init__.pyc", line 1471, in login
File "<decorator-gen-8>", line 2, in request_json
File "praw\decorators.pyc", line 116, in raise_api_exceptions
File "praw\__init__.pyc", line 622, in request_json
File "praw\__init__.pyc", line 453, in _request
File "praw\__init__.pyc", line 434, in handle_redirect
File "praw\handlers.pyc", line 146, in wrapped
File "praw\handlers.pyc", line 56, in wrapped
File "praw\handlers.pyc", line 102, in request
File "requests\sessions.pyc", line 596, in send
File "requests\adapters.pyc", line 497, in send
requests.exceptions.SSLError: [Errno 2] No such file or directory
使用pyinstaller我收到导入错误:
ImportError: No module named ConfigParser
有什么想法吗?