Pyinstaller error Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception! when I tried to make an app from .py file

huangapple go评论74阅读模式
英文:

Pyinstaller error Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception! when I tried to make an app from .py file

问题

以下是您提供的内容的中文翻译:

我在尝试使用pyinstaller从.py文件创建.exe文件时遇到了此错误。
完整错误信息:

回溯(最近的调用最后):
  File "PyInstaller\loader\pyimod02_importers.py", line 22, in <module>
  File "pathlib.py", line 14, in <module>
  File "urllib\parse.py", line 40, in <module>
ModuleNotFoundError: 没有名为'ipaddress'的模块
回溯(最近的调用最后):
  File "PyInstaller\loader\pyiboot01_bootstrap.py", line 17, in <module>
ModuleNotFoundError: 没有名为'pyimod02_importers'的模块
[3236] 由于未处理的异常,无法执行脚本'pyiboot01_bootstrap'!```

我使用pyinstaller但从未遇到错误。
我使用的命令是:

pyinstaller --onefile main.py

Pyinstaller版本:5.8.0

Python版本:3.11.4

Python文件代码:

print('h')


<details>
<summary>英文:</summary>

I got this error when I tried to make an .exe file from .py file with pyinstaller. 
The full error:
```[3236] Module object for pyimod02_importers is NULL!
Traceback (most recent call last):
  File &quot;PyInstaller\loader\pyimod02_importers.py&quot;, line 22, in &lt;module&gt;
  File &quot;pathlib.py&quot;, line 14, in &lt;module&gt;
  File &quot;urllib\parse.py&quot;, line 40, in &lt;module&gt;
ModuleNotFoundError: No module named &#39;ipaddress&#39;
Traceback (most recent call last):
  File &quot;PyInstaller\loader\pyiboot01_bootstrap.py&quot;, line 17, in &lt;module&gt;
ModuleNotFoundError: No module named &#39;pyimod02_importers&#39;
[3236] Failed to execute script &#39;pyiboot01_bootstrap&#39; due to unhandled exception!

I used pyinstaller but I never get an error.
The command what I used:

pyinstaller --onefile main.py

Pyinstaller version: 5.8.0

Python version: 3.11.4

The python file code:

print(&#39;h&#39;)

答案1

得分: 0

我解决了这个问题。我只是删除然后重新安装了pyinstaller。

英文:

I solve the problem. I only removed and installed again pyinstaller.

huangapple
  • 本文由 发表于 2023年7月20日 15:49:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76727728.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定