前幾天在使用PyInstaller打包一個程序時,發現PyInstaller怎麼用都顯示一個錯誤提示:
PyInstaller cannot check for assembly dependencies.
Please install pywin32_ctypes
pip install pywin32_ctypes
1.pywin32_ctypes異常所致
開始時,以爲是長時間不使用PyInstaller,所含pywin32_ctypes不異常破壞了,所以按照提示進行安裝pywin32_ctypes。
C:\Users\Administrator>pip install pywin32_ctypes
Requirement already satisfied: pywin32_ctypes in d:\program files\python37\lib\site-packages (0.2.0)
提示已經安裝過,沒有辦法只能先行把其pip uninstall pywin32_ctypes後,然後再重新安裝;再使用PyInstaller打包,問題依舊存在。
PyInstaller cannot check for assembly dependencies.
Please install pywin32_ctypes
pip install pywin32_ctypes
2.PyInstaller順壞所致
經過第一步後,開始懷疑是PyInstaller異常問題所致,只能重新卸載pip uninstall PyInstaller,完成再pip install PyInstaller.
等待安裝完成,問題依然存在;
PyInstaller cannot check for assembly dependencies.
Please install pywin32_ctypes
pip install pywin32_ctypes
崩潰中... ..., 折騰好長時間,切換目錄,都還是不行。
3.卸載PyInstaller
只能卸載PyInstaller,難不成這個tool有問題,pip uninstall PyInstaller;等待卸載完成; 直接在cmd出現好使了,這是什麼鬼。
推測原因:
PyInstaller在同一PC上允許存在多個版本的,這個多個版本路徑存在差異,又可能我沒有就多個版本添加對應Path路徑;
WINDOWS傻傻的找不到路徑;就出現我上述的問題;
一般在使用PyInstaller時,就出現沒有安裝pywin32以及pywin32_ctypes兩個包,請安裝如下即可。而我這個問題就是特例啦!
pip install pywin32
pip install pywin32-ctypes