PyInstaller exe 给出 cython 错误

PyInstaller exe gives cython error

我正在尝试从 PyQt5 代码创建一个 exe。它最初没有说 文件夹 "Projectfolder\jedi\evaluate\compiled" 丢失。我从 jedi 开始添加了空文件夹。然后失败说 plotly json 文件丢失了。我从站点包中添加了 plotly 文件夹。现在它失败并出现以下错误:

File "pandas\_libs\tslibs\conversion.pyx", line 222, in init pandas._libs.tslibs.conversion
AttributeError: type object 'pandas._libs.tslibs.conversion._TSObject' has no attribute '__reduce_cython__'
[4380] Failed to execute script

我现在很困惑,在 github 上搜索类似的问题,但 Whosebug 并没有太大帮助。我的规格文件如下:

# -*- mode: python -*-
import sys
sys.setrecursionlimit(5000)

block_cipher = None


a = Analysis(['start.py', 'process.py', 'compute.py'],
             pathex=['path to project folder'],
             binaries=[],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=True,
          name='projectname',
          debug=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               name='projectname')

我的代码确实依赖于外部 csv 数据,但在单击按钮之前不会调用它。所以至少应该显示主窗体。有人可以让我知道我做错了什么吗?

谢谢。

我正在浏览以下 link 中的评论: https://github.com/pyinstaller/pyinstaller/issues/3079

终于找到适合我的解决方案。我需要将 pandas 文件夹从 site-packages 复制到 dist。我想如果规范文件配置正确,这是可以避免的事情,但很高兴看到它最终能正常工作!