简体   繁体   English

无法运行 pyinstaller 创建的 exe 文件,显示错误“google-api-python-client was not found”

[英]Unable to run exe file created by pyinstaller, showing error "google-api-python-client was not found"

I am trying to convert a python script to.exe that uses the keys.json file to run.我正在尝试将 python 脚本转换为使用 keys.json 文件运行的.exe。 When I try to run the.exe file I get an error and the window closes automatically in 1-2 seconds.当我尝试运行 .exe 文件时出现错误,window 会在 1-2 秒内自动关闭。

I'm completely lost, I tried some solutions available on the internet but nothing is working, I'm very upset.我完全迷路了,我尝试了一些互联网上可用的解决方案,但没有任何效果,我很沮丧。

My.spec file looks like, My.spec 文件看起来像,

    # -*- mode: python ; coding: utf-8 -*-

    block_cipher = None


    a = Analysis(['SMIDST.py'],
                 pathex=['D:\\code\\SBF Interns APP\\SMIDST'],
                 binaries=[],
                 datas=[('keys.json', '.')],
                 hiddenimports=['pkg_resources.py2_warn', 'googleapiclient', 'apiclient'],
                 hookspath=[],
                 runtime_hooks=[],
                 excludes=[],
                 win_no_prefer_redirects=False,
                 win_private_assemblies=False,
                 cipher=block_cipher,
                 noarchive=False)
    pyz = PYZ(a.pure, a.zipped_data,
                 cipher=block_cipher)
    exe = EXE(pyz,
              a.scripts,
              a.binaries,
              a.zipfiles,
              a.datas,
              [],
              name='SMIDST',
              debug=False,
              bootloader_ignore_signals=False,
              strip=False,
              upx=True,
              upx_exclude=[],
              runtime_tmpdir=None,
              console=True )

Please help me, Thank you in advance !!!请帮助我,在此先谢谢您!!!

Can you change the file read function to embed the file manualy?您可以更改读取 function 的文件以手动嵌入文件吗? If it works maybe it cant find the file.如果它有效,它可能无法找到该文件。 To solve that problem you can try copying the exe to where you main funciton or where you command line sits when its run(pwd path)?要解决该问题,您可以尝试将 exe 复制到您的主要功能或命令行运行时所在的位置(pwd 路径)?

暂无
暂无

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

相关问题 运行 pyinstaller 编译的 EXE 时找不到“google-api-python-client”分发版 | 冻结 importlib._bootstrap - The 'google-api-python-client' distribution was not found on running EXE compiled by pyinstaller | frozen importlib._bootstrap 在运行 pyinstaller 编译的 EXE 时找不到“google-api-python-client”分发版 - The 'google-api-python-client' distribution was not found on running EXE compiled by pyinstaller 未找到“google-api-python-client”分发,并且是带有 pyinstaller 的应用程序所必需的 - The 'google-api-python-client' distribution was not found and is required by the application with pyinstaller 使用google-api-python-client时出错 - Error using google-api-python-client 安装/使用google-api-python-client时出错 - Error while installing / using google-api-python-client 使用 google-api-python-client 拉超时 - Pull timeout with google-api-python-client 无法在 AWS 虚拟机上运行使用 Pyinstaller 创建的 .exe 文件 - Unable to run .exe file created with Pyinstaller on AWS virtual machine python PyInstaller创建的可执行文件无法运行exe错误:找不到Temp \\\\ _ MEI175682(数据文件) - python PyInstaller created executable failed to run the exe Error: cannot find Temp\\_MEI175682 (data file) 使用google-api-python-client访问G Suite Admin SDK时收到403错误 - Receiving 403 error when accessing G Suite Admin SDK using google-api-python-client 使用 google-api-python-client init() 方法时出现 SSL 错误 - SSL error when using google-api-python-client init() method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM