小编per*_*tio的帖子

PyInstaller win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', '系统找不到指定的文件。')

在使用 PyInstaller(开发版本 4.0.dev0+8196c57ab)时,产生了一个 OSError: [WinError 2] 'The system cannot find the file specified.'

  • Python版本:3.7
  • 图形用户界面:PySide2 5.13.0
  • 其他包:lxml、BeautifulSoup、Matplotlib(依赖于 numpy)、Pandas、pypiwin32、reportlab、Theano
  • 蟒蛇 3, 视窗
  • 使用 PyInstaller --onedir 编译

我试过的:

  • 尝试按照此处的建议将 PyInstaller 降级到 2.1:https : //github.com/pyinstaller/pyinstaller/issues/3916但不起作用,因为不支持 Python 3
  • 最初是在 PyInstaller 3.5 上,按照 PyInstaller github 上的一些问题的建议升级到开发版本
  • 尝试包括 --exclude-module=.git
import PyInstaller.__main__

if __name__ == '__main__':
    PyInstaller.__main__.run([
        '--name=%s' % 'Dummy App',
        '--onedir',
        '--nowindowed',
        r'--workpath=C:\Users\User1\Desktop\build7',
        r'--distpath=C:\Users\User1\Desktop\dist7',
        '--hidden-import=theano.tensor.shared_randomstreams',
        '--hidden-import=pandas._libs.tslibs.timedeltas',
        '--clean',
        '--add-data={0};.'.format('redacted.xml'),
        '--add-data={0};{0}'.format('redacted_folder'),
        '--add-data={0};.'.format('redacted.pdf'),
        '--exclude-module={0}'.format('.git'),
        '--log-level=WARN',
        'MainWindow.py'
    ])
Run Code Online (Sandbox Code Playgroud)

完整的堆栈跟踪:

79702 DEBUG: Analyzing .git\objects\78\e83411cea88cd038acb12c005a984fc0d6d423
Traceback (most recent call last): …
Run Code Online (Sandbox Code Playgroud)

environment pywin32 pyinstaller anaconda

8
推荐指数
1
解决办法
7688
查看次数

标签 统计

anaconda ×1

environment ×1

pyinstaller ×1

pywin32 ×1