Pyinstaller 可执行文件在另一台 PC 上打开时抛出错误

Pyinstaller executable file throws an error when opening on another PC

我制作了一个 python 程序,它从文件中读取数据,对其进行计算,然后使用 matplotlib 从数据中绘制图表。然后我使用 pyinstaller --onefile plk.py。当我在我的 PC 上打开该程序时,它工作正常,但是当我将它转移到另一台计算机时,它会抛出错误:

    ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "plk.py", line 3, in <module>
    import matplotlib.pyplot as plt
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\matplotlib\__init__.py", line 138, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\matplotlib\cbook\__init__.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "d:\users\xxx\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
  File "site-packages\numpy\__init__.py", line 305, in <module>
  File "site-packages\numpy\__init__.py", line 302, in _win_os_check
RuntimeError: The current Numpy installation ('C:\Users\zz\AppData\Local\Temp\_MEI86922\numpy\__init__.pyc') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html
[5488] Failed to execute script plk

有人知道解决方法吗?

似乎正在 the thread linked in the error message you provided 中跟踪问题,这是任何人都可能拥有的所有信息。

一个记录在案的解决方法是依赖于 numpy 的特定版本,即 numpy==1.19.3(他们在 1.19.3 中添加了解决方法,并在 1.19.4 中删除了它,因为它破坏了其他Linux).

上的内容

除此之外,您只需要观看线程即可;它声称适当的修复可能会在 2021 年 1 月左右到达。

由于我的声誉,我无法添加评论。但我确实进行了调查,发现 this.

不幸的是,这似乎是一个需要通过 Windows 更新修补的错误,因为它与 Intel 和 AMD 处理器有关。根据史蒂夫的说法,预计到达时间是 2021 年 1 月(单击我嵌入的 link 查看他的评论)。