简体   繁体   English

使用PyInstaller,gspread和oauth2client时出现问题

[英]Problems using PyInstaller, gspread and oauth2client

I'm currently working on a project that heavily relies on gpsread (python 2.7). 我目前正在从事一个严重依赖gpsread(python 2.7)的项目。 I'm in charge of creating a .exe but I've been running into some problems... I have PyOpenSSL installed and the program works fine from the .py 我负责创建.exe,但是我遇到了一些问题...我安装了PyOpenSSL,并且该程序可以从.py正常运行

I'm doing some testing on a simple (and working!) program that does the following: 我正在执行以下操作的简单程序上进行一些测试:

  • Connects to a spreadsheet using gspread 使用gspread连接到电子表格
  • Get information from a specific cell from the spreadsheet 从电子表格中的特定单元格获取信息
  • Update information of a specific cell on the spreadsheet 更新电子表格中特定单元格的信息

When trying to run the .exe using PyInstaller, I get the following : 当尝试使用PyInstaller运行.exe时,我得到以下信息:

Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "CurrentMouse.py", line 53, in spreadsheetOpen
  File "site-packages\oauth2client\util.py"m line 140 in positional_wrapper
  File "site-packages\oauth2client\client.py", line 1630, in __init__
  File "site-packages\oauth2client\client.py", line 1581, in _RequireCryptoOrDie

oauth2client.client.CryptoUnavailableError: No crypto library available
google22nov returned -1

What I get from the console (using Windows 8.1) 我从控制台获得的内容(使用Windows 8.1)

49 INFO: PyInstaller: 3.1
49 INFO: Python: 2.7.11
52 INFO: Platform: Windows-8.1-6.3.9600
52 INFO: wrote C:\Python27\Scripts\google22nov.spec
55 INFO: UPX is not available.
58 INFO: Extending PYTHONPATH with paths
['C:\\Python27\\Scripts', 'C:\\Python27\\Scripts']
58 INFO: checking Analysis
59 INFO: Building Analysis because out00-Analysis.toc is non existent
59 INFO: Initializing module dependency graph...
62 INFO: Initializing module graph hooks...
118 INFO: running Analysis out00-Analysis.toc
122 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by c:\python27\python.exe
279 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.21022.8_none_60a5df56e60dc5df.manifest
282 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
283 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4137_none_f47d3254f657e518.manifest
285 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
286 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.6161_none_f480bfaef65491a5.manifest
288 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.8387_none_f4823b16f6535909.manifest
440 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.307
29.8387_none ...
440 INFO: Found manifest C:\WINDOWS\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8
b3b9a1e18e3b_9.0.30729.8387_none_5094ca96bcb6b2bb.manifest
443 INFO: Searching for file msvcr90.dll
444 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.8387_none_5094ca96bcb6b2bb\msvcr90.dll
444 INFO: Searching for file msvcp90.dll
444 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.8387_none_5094ca96bcb6b2bb\msvcp90.dll
444 INFO: Searching for file msvcm90.dll
446 INFO: Found file C:\WINDOWS\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9
.0.30729.8387_none_5094ca96bcb6b2bb\msvcm90.dll
601 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.21022.8_none_60a5df56e60dc5df.manifest
604 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.1_none_8550c6b5d18a9128.manifest
605 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4137_none_f47d3254f657e518.manifest
605 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.4148_none_f47e1bd6f6571810.manifest
607 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.6161_none_f480bfaef65491a5.manifest
608 INFO: Found C:\WINDOWS\WinSxS\Manifests\x86_policy.9.0.microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.30729.8387_none_f4823b16f6535909.manifest
609 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,
30729, 8387)
689 INFO: Analyzing C:\Python27\Scripts\google22nov.py
2564 INFO: Processing pre-safe import module hook   _xmlplus
5279 INFO: Processing pre-find module path hook   distutils
5407 INFO: Processing pre-safe import module hook   six.moves
6065 INFO: Looking for import hooks ...
6071 INFO: Processing hook   hook-distutils.py
6072 INFO: Processing hook   hook-xml.py
6141 INFO: Processing hook   hook-cryptography.py
6148 INFO: Processing hook   hook-httplib2.py
6151 INFO: Processing hook   hook-httplib.py
6151 INFO: Processing hook   hook-requests.py
6164 INFO: Processing hook   hook-encodings.py
6634 INFO: Looking for ctypes DLLs
6651 INFO: Analyzing run-time hooks ...
6680 INFO: Looking for dynamic libraries
6878 INFO: Looking for eggs
6880 INFO: Using Python library C:\WINDOWS\system32\python27.dll
6880 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVers
ion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 8387), publicKeyToken=u'1fc8b3b9a
1e18e3b')]
6897 INFO: Warnings written to C:\Python27\Scripts\build\google22nov\warngoogle2
2nov.txt
7026 INFO: checking PYZ
7028 INFO: Building PYZ because out00-PYZ.toc is non existent
7028 INFO: Building PYZ (ZlibArchive) C:\Python27\Scripts\build\google22nov\out0
0-PYZ.pyz
7746 INFO: checking PKG
7747 INFO: Building PKG because out00-PKG.toc is non existent
7747 INFO: Building PKG (CArchive) out00-PKG.pkg
7769 INFO: Bootloader c:\python27\lib\site-packages\PyInstaller\bootloader\Windo
ws-32bit\run.exe
7769 INFO: checking EXE
7770 INFO: Building EXE because out00-EXE.toc is non existent
7770 INFO: Building EXE from out00-EXE.toc
7775 INFO: Appending archive to EXE C:\Python27\Scripts\build\google22nov\google
22nov.exe
7783 INFO: checking COLLECT
7785 INFO: Building COLLECT because out00-COLLECT.toc is non existent
7785 INFO: Building COLLECT out00-COLLECT.toc
7792 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 307
29, 8387)

What I have inside my warn .txt file http://pastebin.com/AkP2N6d4 (too long) 我的警告.txt文件http://pastebin.com/AkP2N6d4里面有什么(太长)

Any help would be GREATLY appreciated! 任何帮助将不胜感激! Thanks! 谢谢!

I had a similiar issue. 我有一个类似的问题。 make sure pip is upgraded. 确保点数已升级。 then try to reinstall it. 然后尝试重新安装它。 if it doesnt work then you'll have to download the package and copy it to your python directory yourself. 如果它不起作用,则必须下载该软件包并将其复制到python目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM