亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Python Pyinstaller ERRNO 22 無效參數

Python Pyinstaller ERRNO 22 無效參數

狐的傳說 2023-09-12 16:39:22
我正在嘗試使用 pyinstaller 使我的 python 代碼更加用戶友好,直到昨天,它還在工作。今天運行時出現以下錯誤:C:\Users\user\Desktop\PythonProjects38>pyinstaller --onefile TransmittalEXE.py83 INFO: PyInstaller: 4.083 INFO: Python: 3.8.583 INFO: Platform: Windows-10-10.0.18362-SP084 INFO: wrote C:\Users\user\Desktop\PythonProjects38\TransmittalEXE.spec...31623 INFO: checking PKG31623 INFO: Building PKG because PKG-00.toc is non existent31628 INFO: Building PKG (CArchive) PKG-00.pkg41852 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.41915 INFO: Bootloader c:\users\user\desktop\pythonprojects38\venv\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe41915 INFO: checking EXE41917 INFO: Building EXE because EXE-00.toc is non existent41921 INFO: Building EXE from EXE-00.toc41927 INFO: Updating manifest in C:\Users\user\Desktop\PythonProjects38\build\TransmittalEXE\run.exe.d66z9a0v42037 INFO: Updating resource type 24 name 1 language 042050 INFO: Appending archive to EXE C:\Users\user\Desktop\PythonProjects38\dist\TransmittalEXE.exeTraceback (most recent call last):  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 194, in _run_module_as_main    return _run_code(code, main_globals, None,  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 87, in _run_code    exec(code, run_globals)  File "C:\Users\user\Desktop\PythonProjects38\pyinstaller.exe\__main__.py", line 7, in <module>  File "c:\users\user\desktop\pythonprojects38\venv\lib\site-packages\PyInstaller\__main__.py", line 114, in run    run_build(pyi_config, spec_file, **vars(args))  File "c:\users\user\desktop\pythonprojects38\venv\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)有關更多參考,我嘗試卸載并重新安裝 pyinstaller 和 pywin32 無濟于事。我的命令提示符條目是 pyinstaller --onefile TransmittalEXE.py。還有其他人遇到過這個問題嗎?我在這個論壇上看到過類似的問題,但不是這個確切的問題。
查看完整描述

4 回答

?
元芳怎么了

TA貢獻1798條經驗 獲得超7個贊

我遇到了同樣的問題,我可以通過轉到 Windows 防病毒保護選項并添加我的腳本所在的文件夾作為例外來修復它。

轉到“開始”>“設置”>“更新和安全”>“Windows 安全”,然后選擇“病毒和威脅防護”。在“病毒和威脅防護設置”下,選擇“管理設置”。添加包含所需腳本的文件夾作為例外。


查看完整回答
反對 回復 2023-09-12
?
SMILET

TA貢獻1796條經驗 獲得超4個贊

我花了幾個小時尋找解決方案,幾乎嘗試了互聯網上的所有可能的解決方案,此外,我終于通過安裝較低版本(pyinstaller v5.6.2)而不是最新版本解決了問題,這解決了它我!



查看完整回答
反對 回復 2023-09-12
?
明月笑刀無情

TA貢獻1828條經驗 獲得超4個贊

我今天遇到了同樣的問題。我在 Windows 10 上安裝 Anaconda。我最終嘗試以管理員身份運行 anaconda 提示符并重新運行相同的 pyinstaller 命令。以管理員身份運行解決了我的問題。



查看完整回答
反對 回復 2023-09-12
?
滄海一幻覺

TA貢獻1824條經驗 獲得超5個贊

Without the knowing of the script you are changing to exe, it is difficult to guess. The attached slice from the command line in your question about the error also says nothing, as @Eric Sunrightly pointed out. So it remains to give the reason for the error in other cases seemingly not necessarily related to your question, hoping that through the associations it will be possible to remove the cause of the error in yours and maybe in other cases. Eventually, I found this question looking for an answer to the same error. For me, the reason for the error was to provide the optional argument –icon=app.ico. It turned out that a file with the extension .ico was not an icon at all, but a different format, changed by the changing only the extension. When I changed a file saved in the format . png to .ico in the correct way pyinstaller stopped reporting an error.


查看完整回答
反對 回復 2023-09-12
  • 4 回答
  • 0 關注
  • 176 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號