[英]How to solve the "pip install pygame" issue?
我正在嘗試在 cmd 中使用命令pip install pygame
,但出現錯誤。 錯誤顯示如下:
C:\Users\Administrator>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/80/2c/3a52e7e9c097229b026b4efbe6711c600f3a84ffdc5f11fd9e7f8932368e/pygame-1.9.6-cp37-cp37m-win32.whl
Installing collected packages: pygame
Could not install packages due to an EnvironmentError: [WinError 5] 拒絕訪問。: 'c:\\program files (x86)\\python37-32\\Lib\\site-packages\\pygame'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
我按照錯誤中的說明操作,但仍然無法解決問題。 而且我還發現無法正確安裝任何“pip”命令。
您可以按照以下步驟以管理員身份安裝軟件包:
1.右鍵單擊命令提示符圖標 2.選擇選項:以管理員身份運行此程序 3.運行命令:pip install pygames
您可以使用命令pip install --user pygames
通過打開命令提示符並輸入以下命令來檢查 Pip 是否已正確安裝:
pip -V
輸出應該是這樣的:
pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
如果 pip 未安裝,請復制此文件鏈接並將其保存到 setup.py 現在打開 cmd 並通過鍵入運行腳本
python setup.py
欲了解更多詳情,請查看鏈接。
當pip in install 正確安裝時運行這個commond
python -m pip install -u pygame --user
為此,您必須從 cmd(在 Windows 上)或從終端(在 mac 上)安裝pygame包。 只需輸入pip install pygame。如果它對您不起作用,請嘗試使用此語句pip3 install pygame。 如果它仍然顯示錯誤,那么您的設備上沒有安裝 pip,請先嘗試安裝 pip。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.