代码之家  ›  专栏  ›  技术社区  ›  user32882

PyInstaller的问题

  •  2
  • user32882  · 技术社区  · 7 年前

    我想使用PyInstaller将一个应用程序捆绑到一个可执行文件中。我有问题是因为 geopandas throwaway.py 仅包含以下导入:

    import geopandas

    然而,运行 pyinstaller throwaway.py PyQt5 仅此而已 matplotlib 进口。

    的日志 pyinstaller 太长,无法包含在此处,但以下显示了最后遇到的异常:

    Exception:
                Cannot find existing PyQt5 plugin directories
                Paths checked: c:/qt/qt_1489878162099/_b_env/Library/plugins
    

    我不知道如何处理这个问题,但有几个概念上的选择:

    • 在matplotlib的导入过程中,找到一种排除geopandas的方法。我没有使用matplotlib,所以我不需要首先打包它
    • 找出出现此问题的原因并加以预防/解决

    2 回复  |  直到 7 年前
        1
  •  2
  •   Panos Kalatzantonakis    7 年前

    这个 pyinstaller -y -d --clean throwaway.py 对我有用。

    enter image description here

    question .

    有一个递归限制的问题,声明 here 试着这样增加:

    import sys
    sys.setrecursionlimit(5000)
    
        2
  •  1
  •   user32882    7 年前

    pyinstaller 具体如下:

    pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

    this link conda-forge 分配 仍不包括 this change 它包含在开发版本中。更改之前的代码是导致问题中出现错误的原因。

    康达锻造厂 发行部门很快就会将此纳入主要发行部门。

    • 安装PyInstaller的开发版本并使用它
    • 手动进入 ~\anaconda3\Lib\site-packages\PyInstaller\utils\hooks\qt.py here