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 ...
随机推荐
- 如何正确运用break、continue和return
break.continue和return 一.break 作用:跳出(离break语句最近的)循环 栗子: for(int i = 1;i <= 100;i++){ System.out.pr ...
- 为什么 HashMap 的容量大小要设置为2的N次方?
原文链接:https://www.changxuan.top/?p=1208 前两天,我在一位同学提交中看到了下面这样的一行代码,让我很是惊讶. Map<String, String> t ...
- LightningChart解决方案:XY和3D图表(Polymer Char GPC-IR®-工程案例)
LightningChart解决方案:XY和3D图表(Polymer Char GPC-IR-工程案例) 所在行业:石化公司成立时间:1992年LightningChart解决方案:XY和3D图表 P ...
- Tensorflow环境配置&安装
Tensorflow环境配置&安装 明知故犯,是不想有遗憾. 背景:Tensorflow 环境配置和安装. 一.安装 Anaconda 二.建立.激活.安装.验证.使用 Tensorflow ...
- MySQL 存储函数的创建、调用、查找
MySQL存储函数(自定义函数),函数一般用于计算和返回一个值,可以将经常需要使用的计算或功能写成一个函数 1.创建存储函数:使用 create function关键字 2.调用存储函数: 3.示例: ...
- robots.txt协议如何设置禁止搜索引擎抓取?
什么情况下要设置禁止搜索引擎抓取自己的网站呢? 公司内部测试的网站,或者内部网,或者后台登录的页面,肯定不希望被外面的人搜索到,所以要禁止搜索引擎抓取.还有在我们的网站还未正式上线之前,我们需要做大量 ...
- asp.net url参数中有中文request.querystring 乱码
说明: 从这点我们发现:所有的参数输入,都调用了一次:HttpUtility.UrlDecode(str2, encoding); 结论出来了: 当客户端js对中文以utf-8编码提交到服务端时,用R ...
- MongoDB导入bson文件(元数据),mongorestore命令行方式导入
MongoDB导入bson文件(元数据),mongorestore命令行方式导入 不推荐使用MongoDB Compass等图形化数据库管理软件,例如MongoDB Compass只能导入json和c ...
- 【mybatis-plus】分页、逻辑删除
通过mybatis-plus实现分页,也是很简单,插件大法. 一.分页 1.配置分页插件 把分页的插件也配置到统一的配置类里: @Configuration // 配置扫描mapper的路径 @Map ...
- [leetcode]110BalancedBinaryTree平衡二叉树
public boolean isBalanced(TreeNode root) { int res = helper(root); if (res<0) return false; retur ...