【问题标题】:Pyinstaller and Pandas Error when exporting导出时 Pyinstaller 和 Pandas 错误
【发布时间】:2018-12-04 16:58:40
【问题描述】:

我有一个使用 tkinter 和 Pandas 的工作项目,但每当我尝试使用 Pyinstaller 导出它时,当我将 pandas 导入我的项目时,它会显示错误。

    57986 WARNING: Cannot read QLibraryInfo output: raised Expecting value: line 1 column 1 (char 0) when decoding:
Traceback (most recent call last):
  File "<string>", line 11, in <module>
ImportError: DLL load failed: The specified procedure could not be found.
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "c:\python36\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\python36\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\python36\lib\site-packages\PyInstaller\building\build_main.py", line 838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\python36\lib\site-packages\PyInstaller\building\build_main.py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 17, in <module>
  File "c:\python36\lib\site-packages\PyInstaller\building\build_main.py", line 241, in __init__
    self.__postinit__()
  File "c:\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "c:\python36\lib\site-packages\PyInstaller\building\build_main.py", line 500, in assemble
    module_hook.post_graph()
  File "c:\python36\lib\site-packages\PyInstaller\building\imphook.py", line 410, in post_graph
    self._load_hook_module()
  File "c:\python36\lib\site-packages\PyInstaller\building\imphook.py", line 377, in _load_hook_module
    self.hook_module_name, self.hook_filename)
  File "c:\python36\lib\site-packages\PyInstaller\compat.py", line 736, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 823, in load_module
  File "<frozen importlib._bootstrap_external>", line 682, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\python36\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py", line 23, in <module>
    collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
  File "c:\python36\lib\site-packages\PyInstaller\utils\hooks\qt.py", line 67, in __getattr__
    qli = json.loads(json_str)
  File "c:\python36\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "c:\python36\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "c:\python36\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

这是我第一次导出到 exe。我已经重新安装了 pyinstaller pyqt5、pandas,但仍然没有。 我正在使用

  • Windows 10
  • python 3.6
  • 我使用 Pip 安装库

库:pandas、pyinstaller。

【问题讨论】:

  • 这是完整的错误信息吗(我被三个点弄糊涂了)。如果没有,请发布完整的错误消息。另外,您能否添加更多关于这是什么环境的信息(Windows?Anaconda?...)

标签: python pandas pyinstaller


【解决方案1】:
collect_system_data_files(pyqt5_library_info.location['PrefixPath']

这表明在收集系统数据文件时出现错误。尝试安装 PyQt5,然后运行 ​​PyInstaller。

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。经过几个小时的折腾,我相信删除我计算机上的旧版 python 是修复它的原因,尽管我不能绝对肯定,因为我做了很多事情。如果你有其他版本的 python,我建议尝试卸载它们,然后通过 pip 卸载并重新安装程序的依赖项。然后确保您能够从 cmd:C:\&lt;path to the location of myProgram&gt;\&gt;python myProgram.py 运行您的 python 脚本myProgram.py。解决在尝试使用 pyinstaller 之前可能发生的任何错误,它为我解决了这个特定错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      • 2015-05-20
      • 2017-09-30
      • 1970-01-01
      • 2015-12-04
      • 2021-12-18
      • 2013-09-01
      相关资源
      最近更新 更多