pyinstaller打包shotgun有关的程序
By 鬼猫猫 http://www.cnblogs.com/muyr/
背景
使用pyinstaller打包跟shotgun有关的程序后,在自己电脑上运行都OK,但是编译好的exe在其他人的电脑上运行失败(就是连接Shogun那一步出错),错误内容为:
Traceback (most recent call last):
File "<string>", line 286, in slotSetting
File "<string>", line 28, in connectShotgun
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 307, in __init__
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 326, in server_caps
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 353, in info
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 1418, in _call_rpc
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 1514, in _make_call
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.shotgun", line 1532, in _http_request
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.lib.httplib2", line 1441, in request
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.lib.httplib2", line 1193, in _request
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.lib.httplib2", line 1128, in _conn_request
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.lib.httplib2", line 895, in connect
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\shotgun_api3.lib.httplib2", line 77, in _ssl_wrap_socket
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\ssl", line 381, in wrap_socket
File "d:\mu_ref\pyinstaller\timelogs\build\timelogs\out00-PYZ.pyz\ssl", line 141, in __init__
ssl.SSLError: [Errno 185090050] _ssl.c:340: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
分析
出错原因:https://github.com/kennethreitz/requests/issues/557
解决方法:http://stackoverflow.com/questions/14486631/pyinstaller-compiled-file-has-ssl-issue-error-185090050
出错的大概原因是:pyinstaller可能没有将httplib2中的cacert.txt
文件打包进来,导致编译完成的exe运行时加载失败。
解决方法
在开发过程,不需要修改什么,该怎么弄怎么弄。
在打包之前,需要修改一点shotgun_api3,比如我的是在C:\Python27\Lib\site-packages\shotgun_api3-3.0.14-py2.7.egg\shotgun_api3\lib\httplib2
文件夹里,中的__init__.py
第180和181行,将
CA_CERTS = os.path.join(os.path.dirname(os.path.abspath(__file__)), "cacerts.txt")
改为
CA_CERTS = os.path.join(os.path.dirname(os.path.abspath(sys.executable)), "cacerts.txt")
然后再执行pyinstaller打包过程,完成之后,将httplib2文件夹里面的cacert.txt
拷贝一份到打包好的.exe相同层级即可。
注意:打包完了,记得将init.py改回来啊,别影响了(其他)项目的开发
Powered by Sublog
pyinstaller打包shotgun有关的程序的更多相关文章
- pyinstaller打包第一个wxPython程序HelloWorld
pyinstaller 打包hello 7Mb ================= www.pyinstaller.org pip install pypiwin32 pip install pyin ...
- 最干净的pyinstaller打包成exe应用程序方法
在anaconda环境下进行pyinstaller打包后,程序非常大,70行代码打包后有280MB,这是因为会将conda环境携带的库都打包进去导致的.为了获得更纯净的包环境,我们需要安装纯pytho ...
- pyinstaller打包自己的python程序
使用Pyinstaller打包步骤如下 1. 安装pyinstaller pip install pyinstaller 查看安装的版本 pyinstaller --version 2. 给脚本加密 ...
- pyinstaller打包好的.exe程序在别的电脑上运行出错
打开.exe提示: Failed to execute script... 查看命令行错误提示为: 总的来说呢,就是有的版本pyqt5库对系统变量的加载存在bug,具体原因只有官方才能解释了,咱也没法 ...
- pyinstaller 打包.exe文件记录遇到的问题
用pyinstaller打包py2.7的程序有时会出现不匹配的错误,在python的idle下运行没有问题,打包之后却会报一些错误,所以打包的话还是尽量用py3.5版本,而且用 -F 将程序打包成一个 ...
- [python学习笔记] pyinstaller打包pyqt5程序无法运行
问题 pyinstaller打包的pyqt5程序在部分电脑上会失败.用户截图提示下边错误日志 无法定位程序输入点 ucrtbase.terminate 于动态链接库 api-ms-win-crt-ru ...
- PyInstaller 打包 python程序成exe
pychaim下PyInstaller 打包 python程序 主题是使用PyInstaller 打包python时遇到一些问题以及解决方案,其中将要打包的程序是用tensorflow做的LSTM算法 ...
- pyinstaller打包程序 带图片
首选说一下,这种打包方式只能在本电脑上使用运行正常 准备:.py文件:你的程序 gif文件:你要用的图片 第一步: 在上面文件所在目录打开cmd 输入 pyi-makespec FP.py 会生成一个 ...
- 关于pyinstaller打包程序时设置icon时的一个坑
关于pyinstaller打包程序时设置icon时的一个坑 之前在用pyinstaller打包程序的时候遇到了关于设置图标的一点小问题,无论在后面加--icon 或是-i都出现报错.查了下st ...
随机推荐
- SQL注入-DNS注入(二)
其实就是盲注的简化版本,不过这种方式确实简单,不需要写py脚本一点点去跑 参考文章: https://www.jianshu.com/p/c805209244c2 这 ...
- hugging face-基于pytorch-bert的中文文本分类
1.安装hugging face的transformers pip install transformers 2.下载相关文件 字表: wget http://52.216.242.246/model ...
- zabbix学习(一)——LNMP环境搭建及zabbix安装
第一部分:LNMP环境搭建 一.环境说明: OS: centos7.6_x64nginx:nginx-1.16.0php: php-7.1.11mysql:mysql-5.6.44 zabbi ...
- C#反编译工具ILSpy 反汇编
ILSpy反编译工具之C#反汇编 1.下载ILspy工具 https://github.com/icsharpcode/ILSpy#ilspy------- 注意: ILspy需要在电脑上安装.N ...
- Liunx运维(六)-文件备份与压缩命令
文档目录: 一.tar:打包备份 二.gzip:压缩或解压文件 三.zip:打包和压缩文件 四.unzip:解压zip文件 五.scp:远程文件复制 六.rsync:文件同步工具 ---------- ...
- cannot be converted to List<List<Integer>>
错误写法: List<List<Integer>> resList = new ArrayList<ArrayList<Integer>>(); 正 ...
- [每日一题]面试官问:Async/Await 如何通过同步的方式实现异步?
关注「松宝写代码」,精选好文,每日一题 时间永远是自己的 每分每秒也都是为自己的将来铺垫和增值 作者:saucxs | songEagle 一.前言 2020.12.23 日刚立的 flag,每日一 ...
- [C#] 使用 Excel 和 Math.Net 进行曲线拟合和数据预测
以前在工作中遇到了一个数据错误的问题,顺便写下 用 Math.Net 解决的思路. 1. 错误的数据 上图是同一组探测器在同一天采集到的 19 次数据,总体来说重复性不错,但很明显最后 8 个探测器出 ...
- java内部类笔记
内部类 1. 普通内部类 <pre name="code" class="java">class className{ [private|pro ...
- java interface和class中的协变
协变 Java中的协变是指,当发生继承时,子类中重写父类的方法时,可以返回父类方法返回类型的子类型.比如: class SuperClass{} class SubClass extends Supe ...