方法 1:把 Scripts 資料夾加到 PATH
找到路徑:
程式碼C:\Users\Anderson0709\AppData\Roaming\Python\Python314\Scripts這裡應該有
whisper.exe。在 Windows 搜尋「環境變數」→ 打開 編輯系統環境變數。
在「使用者變數」或「系統變數」找到 Path → 編輯 → 新增:
程式碼C:\Users\Anderson0709\AppData\Roaming\Python\Python314\Scripts按下確定,重新開啟 PowerShell。
測試:
powershellwhisper --help
方法 2:直接用 Python 執行(不用改 PATH)
如果你不想改環境變數,可以直接用:
python -m whisper --help
python -m whisper your_audio_file.mp3 --model small
✅ 建議:先試試 python -m whisper --help,確認 Whisper 可以跑;再把 Scripts 資料夾加到 PATH,這樣就能直接用 whisper 指令了。
這個不是 ffmpeg 的問題,是 Chocolatey 權限/鎖檔卡死,而且我可以很明確跟你說:不用重裝 Windows,也不用放棄。
重點只有一句話👇
👉 你現在不是用「系統管理員」身分在跑 PowerShell,而且 Choco 之前留下了鎖檔
問題重點(白話版)
錯誤在這幾句:
-
Unable to obtain lock file access -
UnauthorizedAccessException -
拒絕存取 C:\ProgramData\chocolatey\lib-bad
意思是:
-
Chocolatey 在
C:\ProgramData(系統資料夾) -
沒有管理員權限
-
或之前安裝中斷 → 鎖檔殘留
✅ 解法 A(最快、最乾淨,強烈推薦)
1️⃣ 關掉現在的 PowerShell
全部關掉。
2️⃣ 用「系統管理員」開 PowerShell
很重要 ⚠️
-
開始功能表
-
搜尋 PowerShell
-
👉 右鍵 → 以系統管理員身分執行
你會看到視窗標題寫:
Administrator: Windows PowerShell
3️⃣ 手動刪掉卡住的鎖檔(安全)
在「管理員 PowerShell」貼上:
(這只是清垃圾,不會壞系統)
4️⃣ 再裝一次 ffmpeg
5️⃣ 驗證
看到版本資訊 = 100% 成功
✅ 解法 B(如果你不想再碰 Chocolatey)
直接手動裝 ffmpeg(Whisper 完全 OK)
步驟超簡版
-
下載 ffmpeg(Windows build)
-
解壓到例如:
-
確認有:
-
把
C:\ffmpeg\bin加進 PATH -
重開 PowerShell
-
測試:
👉 Whisper 不在乎你用不用 choco,只在乎 ffmpeg.exe 找不找得到
沒有留言:
張貼留言