[英]Cannot create .exe file with pyinstaller
語言:python 3.7.4
當我嘗試使用 pyinstaller 將我的 python 文件轉換為 exe 文件時,它無法正常工作。
當我在保存 python 文件的同一目錄中運行以下命令時,
pyinstaller test.py --noconsole --onefile
控制台中出現以下錯誤消息,並且沒有獲取“.exe”文件。
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_pydoc required by hook for module C:\Users\user\Anaconda3\lib\site-packages\PyInstaller\hooks\hook-pydoc.py. Please check whether module __PyInstaller_hooks_0_pydoc actually exists and whether the hook is compatible with your version of C:\Users\hiro\Anaconda3\lib\site-packages\PyInstaller\hooks\hook-pydoc.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.
有人對這個問題有幫助嗎?
或者,正如錯誤消息的最后一句話所說,
You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.
Pyinstaller 有問題?
如果需要更多信息,我會補充。 謝謝你。
當您的主文件調用其他目錄上的文件時發生錯誤。
例如:- test.py 在 DB 文件夾中使用 db.py。
嘗試使用“-D”標志執行命令。
pyinstaller -D --noconsole test.py
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.