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 ...
随机推荐
- 如何在Ubuntu Server 18.04 LTS中配置静态IP地址
安装Ubuntu Server 18.04后需要分配一个的静态IP地址.先前的LTS版本Ubuntu 16.04使用/etc/network/interfaces文件配置静态IP地址,但是Ubuntu ...
- python线性回归
一.理论基础 1.回归公式 对于单元的线性回归,我们有:f(x) = kx + b 的方程(k代表权重,b代表截距). 对于多元线性回归,我们有: 或者为了简化,干脆将b视为k0·x0,,其中k0为1 ...
- idea2020 没有 Autoscroll from Source
2018版本: 2020版本: 最后在官网的网站中找到了解决方案,原来是改名了: 网址:https://intellij-support.jetbrains.com/hc/en-us/communit ...
- Tomcat服务器的下载以及配置
1,Tomcat的下载与安装 本人采用的是解压版安装,只需要在官网(https://tomcat.apache.org/)下载好压缩版的Tomcat,再解压在你想安装的目录下即可.我的安装目录是D:\ ...
- 仿小米logo案例
效果:做一个具有logo能过渡切换效果,类似于小米网站的logo 思路:将两个用于切换的logo以文字形式嵌入活动块banner的左右半,活动块banner的上级是主展示块box,初态只展示右半log ...
- Java利用VLC开发简易视屏播放器
1.环境配置 (1)下载VLC VlC官网http://www.videolan.org/ 各个版本的下载地址http://download.videolan.org/pub/videolan ...
- Map遍历的几种方式
代码示例 /** * @author liaowenhui * @date 2020/6/25 11:15 */ public class TestMap { public static void m ...
- 【小菜学网络】MAC地址详解
上一小节介绍了以太网帧的结构,以及帧中各个字段的作用.参与以太网通讯的实体,由以太网地址唯一标识.以太网地址也叫做 MAC 地址,我们对它仍知之甚少. 以太网地址在不同场景,称谓也不一样,常用叫法包括 ...
- Dota游戏匹配的所有组合
在Dota游戏中有一种匹配玩法,任意5人以下玩家组队,加入匹配系统,由系统组合出5人 vs 5人的组合进行游戏,比如2人+3人 vs 1人+4人.抽象出这个问题,就变成两边各有m个玩家,最多允许n个 ...
- Solon rpc 之 SocketD 协议 - RPC鉴权模式
Solon rpc 之 SocketD 协议系列 Solon rpc 之 SocketD 协议 - 概述 Solon rpc 之 SocketD 协议 - 消息上报模式 Solon rpc 之 Soc ...