我正在尝试使用 pyinstaller 将程序转换为 exe。该程序执行用户计算机的硬件评估,包括使用 speedtest-cli 运行互联网速度测试。该程序运行良好,直到我编译它,此时我收到以下错误:
Traceback (most recent call last): File "speedtest.py", line 156, in <module> ModuleNotFoundError: No module named '__builtin__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "hw-assesment-tool.py", line 9, in <module> File "<frozen importlib._bootstrap>", line 1007, in
_find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 546, in exec_module File "speedtest.py", line 179, in <module> File "speedtest.py", line 166, in __init__ AttributeError: 'NullWriter' object has no attribute 'fileno'
我已经尝试升级并重新安装 speedtest-cli 并没有解决问题。
PS这是错误的截图: