pip 無法正確更新或安裝模組

pip 無法正確更新或安裝模組

我已經多次嘗試使用幾個不同的軟體包,並嘗試升級 pip。我願意

C:\Users\Michael>pip install pillow
Collecting pillow
  Downloading https://files.pythonhosted.org/packages/40/f2/a424d4d5dd6aa8c26636969decbb3da1c01286d344e71429b1d648bccb64/Pillow-6.0.0-cp37-cp37m-win_amd64.whl (2.0MB)
    100% |████████████████████████████████| 2.0MB 1.8MB/s
Installing collected packages: pillow
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files\\python37\\Lib\\site-packages\\PIL'
Consider using the `--user` option or check the permissions.

You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

答案1

分開訊息:

Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files\\python37\\Lib\\site-packages\\PIL'
Consider using the `--user` option or check the permissions.

這意味著您的用戶不允許在上面的目錄中建立文件。您需要以管理使用者身分執行終端或僅執行命令。或者,您可以將--user標誌新增至命令中(如pip install --user pillow)以將程式安裝在使用者擁有的目錄中。這將使該程式僅可供該用戶使用。

You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

這只是一條通用訊息,暗示有更新版本的 Pip 可用,並敦促您升級。同樣的權限問題將適用於它建議運行的命令。

相關內容