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有关的程序的更多相关文章

  1. pyinstaller打包第一个wxPython程序HelloWorld

    pyinstaller 打包hello 7Mb ================= www.pyinstaller.org pip install pypiwin32 pip install pyin ...

  2. 最干净的pyinstaller打包成exe应用程序方法

    在anaconda环境下进行pyinstaller打包后,程序非常大,70行代码打包后有280MB,这是因为会将conda环境携带的库都打包进去导致的.为了获得更纯净的包环境,我们需要安装纯pytho ...

  3. pyinstaller打包自己的python程序

    使用Pyinstaller打包步骤如下 1. 安装pyinstaller pip install pyinstaller 查看安装的版本 pyinstaller --version 2. 给脚本加密 ...

  4. pyinstaller打包好的.exe程序在别的电脑上运行出错

    打开.exe提示: Failed to execute script... 查看命令行错误提示为: 总的来说呢,就是有的版本pyqt5库对系统变量的加载存在bug,具体原因只有官方才能解释了,咱也没法 ...

  5. pyinstaller 打包.exe文件记录遇到的问题

    用pyinstaller打包py2.7的程序有时会出现不匹配的错误,在python的idle下运行没有问题,打包之后却会报一些错误,所以打包的话还是尽量用py3.5版本,而且用 -F 将程序打包成一个 ...

  6. [python学习笔记] pyinstaller打包pyqt5程序无法运行

    问题 pyinstaller打包的pyqt5程序在部分电脑上会失败.用户截图提示下边错误日志 无法定位程序输入点 ucrtbase.terminate 于动态链接库 api-ms-win-crt-ru ...

  7. PyInstaller 打包 python程序成exe

    pychaim下PyInstaller 打包 python程序 主题是使用PyInstaller 打包python时遇到一些问题以及解决方案,其中将要打包的程序是用tensorflow做的LSTM算法 ...

  8. pyinstaller打包程序 带图片

    首选说一下,这种打包方式只能在本电脑上使用运行正常 准备:.py文件:你的程序 gif文件:你要用的图片 第一步: 在上面文件所在目录打开cmd 输入 pyi-makespec FP.py 会生成一个 ...

  9. 关于pyinstaller打包程序时设置icon时的一个坑

    关于pyinstaller打包程序时设置icon时的一个坑     之前在用pyinstaller打包程序的时候遇到了关于设置图标的一点小问题,无论在后面加--icon 或是-i都出现报错.查了下st ...

随机推荐

  1. pandas的学习3-设置值

    import pandas as pd import numpy as np # 我们可以根据自己的需求, 用 pandas 进行更改数据里面的值, 或者加上一些空的,或者有数值的列. # 首先建立了 ...

  2. GitHub 上的大佬们打完招呼,会聊些什么?

    你好 GitHub!每一位开源爱好者的好朋友「HelloGitHub」 大家好,今儿 HG 有幸邀请到:Lanking 一位亚马逊 AI 软件工程师.开源爱好者和贡献者.他是亚马逊开源的 Java 深 ...

  3. 用Python写个开心消消乐小游戏

    本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理 提到开心消消乐这款小游戏,相信大家都不陌生,其曾在 2015 年获得过玩家最喜爱的移动单机游戏奖,受 ...

  4. Python编程学习爆破一些简单加密的文件

    前言 这里只是分享一下Python如何生成爆破字典,对于简单的一些加密文件,咱们可以跑字典获取正确的密码,比如zip加密文件.这里小编给大家简单的介绍一下爆破字典的方法,希望对大家学习Python有帮 ...

  5. PHP7.4.3的BUG导致微信公众号CURl上传文件的412错误

    https://segmentfault.com/q/1010000021407039 升级PHP就好了 https://segmentfault.com/q/1010000021407039

  6. OAuth2.0的四种授权模式(转)

    1. OAuth2简易实战(一)-四种模式 1.1. 隐式授权模式(Implicit Grant) 第一步:用户访问页面时,重定向到认证服务器. 第二步:认证服务器给用户一个认证页面,等待用户授权. ...

  7. [leetcode]29. Divide Two Integers不用除法实现除法

    思路是不断将被除数分为两部分,每次分的一部分都是尽量大的除数的倍数,然后最后的商就是倍数加上剩下的部分再分,知道不够大. 递归实现 剩下的难点就是,正负号(判断商正负后将两个数都取绝对值),数太大(将 ...

  8. docker 使用教程1

    1.概念理解 镜像:docker镜像就像一个个模具. 容器:docker容器就是模具翻模出来的东西. 仓库:仓库就是存放模具的地方. 下面通过运行 hello-world 来理解 docker镜像运行 ...

  9. niceyoo的2020年终总结-2021年Flag

    碎碎念,向本命年说再见! 又到了一年一度立 Flag 的时间了,怎么样,去年的 Flag 大家实现的怎么样?还有信心立下 2021 年的 Flag 吗~ 今年我算比较背的,年初的一次小意外,直接在床上 ...

  10. 负载均衡各个算法JAVA诠释版

    00 前言 首先给大家介绍下什么是负载均衡(来自百科) 负载均衡建立在现有网络结构之上,它提供了一种廉价有效透明的方法扩展 网络设备和 服务器的带宽.增加 吞吐量.加强网络数据处理能力.提高网络的灵活 ...