問題:pycharm中安裝pygame失敗
解決方法:下載國內代替的libs
步驟:
- 進入cmd,輸入python
C:\Users\chendh>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
- 進入:https://www.lfd.uci.edu/~gohlke/pythonlibs/,搜索:pygame
- 選擇適合自己電腦的版本,這裏注意看自己裝的是32的還是64的,不要以爲自己電腦是64位的就理所當然了
- 像我的就是pygame-1.9.6-cp38-cp38-win32.whl
- 下載完之後,拷貝到python的安裝目錄下,比如:D:\Python3\Scripts
- 進入上面的那個目錄,shift+鼠標右鍵,調出cmd,輸入命令:pip install pygame-1.9.6-cp38-cp38-win32.whl
安裝成功效果如下:
D:\Python3\Scripts>pip install pygame-1.9.6-cp38-cp38-win32.whl
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing d:\python3\scripts\pygame-1.9.6-cp38-cp38-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.6