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 ...
随机推荐
- 容器编排系统之DaemonSet、Job和CronJob控制器
前文我们了解了k8s上的pod控制器中的常用的两种控制器ReplicaSet和Deployment控制器的相关话题,回顾请参考:https://www.cnblogs.com/qiuhom-1874/ ...
- matplotlib的学习7-tick能见度
import matplotlib.pyplot as plt import numpy as np ''' 当图片中的内容较多,相互遮盖时,我们可以通过设置相关内容的透明度来使图片更易于观察,也即是 ...
- Spring框架之spring-web http源码完全解析
Spring框架之spring-web http源码完全解析 Spring-web是Spring webMVC的基础,由http.remoting.web三部分组成. http:封装了http协议中的 ...
- python的常用内建模块与常用第三方模块
本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理 一.常用内置模块1.datetimePython 提供了一个 time 和 calendar 模块可 ...
- python之代码重构
在撸码过程中,总有很多代码需要重构,码一个问候用户的小例子,加深对代码重构的印象. 原始代码: 1 import json 2 3 filename = 'username.json' #定义文件名 ...
- locust的使用
一.简介 Locust是一款使用Python编写的压力测试工具,本篇总结会介绍在实际测试过程中遇到的问题 https://www.locust.io/ 使用Locust的原因是因为可以模拟的用户数量可 ...
- 【终极版】利用阿里云云解析API实现动态域名解析(ddns),搭建私有服务器【含可执行文件和源码】
前言:懒人可以直接往下看,有代码和全部资源可以下载.此文章是先前文章的定时版,主要是添加了定时执行的功能,并且将代码中的配置项放置到了app.config文件中,方便不懂开发的朋友修改使用.未经许可请 ...
- PPT技术干货1(上)——设计审美
序言 PPT直接反映了一个人的能力和态度,PPT能直接反映出老板最看重的4个关键能力: 逻辑思维:全局思考,洞察关键 数据思维:数据分析,指导决策 设计思维:美观大方,彰显专业 工作效率:效率高,出活 ...
- jQuery 库中的 $() 是什么?
概述: $() 函数是 jQuery() 函数的别称. $() 函数用于将任何对象包裹成 jQuery 对象,接着就被允许调用定义在 jQuery 对象上的多个不同方法. 可以将一个选择器字符串传入 ...
- 自动化运维工具-Ansible之1-基础
自动化运维工具-Ansible之1-基础 目录 自动化运维工具-Ansible之1-基础 Ansible 基本概述 定义 特点 架构 工作原理 任务执行模式 命令执行过程 Ansible 安装 Ans ...