Python 熊猫和熊猫

Python 熊猫和熊猫,python,pandas,pyinstaller,Python,Pandas,Pyinstaller,我想使用pyinstaller将python脚本转换为exe文件。我的python脚本有一个程序库。如何使用pyinstaller部署pandas库。我已尝试修改规范文件,如中所述。但我在转换文件时遇到以下错误 我使用的规范文件 # -*- mode: python -*- block_cipher = None def get_pandas_path(): import pandas pandas_path = pandas.__path__[0] return

我想使用pyinstaller将python脚本转换为exe文件。我的python脚本有一个程序库。如何使用pyinstaller部署pandas库。我已尝试修改规范文件,如中所述。但我在转换文件时遇到以下错误

我使用的规范文件

# -*- mode: python -*-

block_cipher = None

def get_pandas_path():
    import pandas
    pandas_path = pandas.__path__[0]
    return pandas_path

a = Analysis(['test.py'],
         pathex=['D:\\test.py'],
         binaries=None,
         datas=None,
         hiddenimports=[],
         hookspath=None,
         runtime_hooks=None,
         excludes=None,
         win_no_prefer_redirects=None,
         win_private_assemblies=None,
         cipher=block_cipher)

dict_tree = Tree(get_pandas_path(), prefix='pandas', excludes=["*.pyc"])
a.datas += dict_tree
a.binaries = filter(lambda x: 'pandas' not in x[0], a.binaries)

pyz = PYZ(a.pure, a.zipped_data,
         cipher=block_cipher)
exe = EXE(pyz,
      a.scripts,
      exclude_binaries=True,
      name='test',
      debug=False,
      strip=None,
      upx=True,
      console=True )
scoll = COLLECT(exe,
           a.binaries,
           a.zipfiles,
           a.datas,
           strip=None,
           upx=True,
           name='test')

有谁能帮我找到错误的地方。

我尝试卸载pandas并重新安装。现在它正在工作。

我尝试卸载pandas并重新安装。现在它正在工作