Windows安裝pip和pygame詳細教程(附國內下載地址)

今天想做個飛機大戰鞏固下python的語法,最近換電腦了還沒來得及安裝,正好寫一篇博客記錄一下,因爲原理犯過很多錯誤,在這裏記錄下來!

一、準備工作

1、python安裝包
2、pip安裝包
3、pygame安裝包

pip下載源:
https://pypi.org/simple/pip/
pygame下載源:
http://mirrors.aliyun.com/pypi/simple/pygame/

二、開始安裝

1、安裝python並加入環境變量
安裝python過程省略,這裏寫個添加到環境變量的過程
找到安裝python的路徑並複製

在這裏插入圖片描述

2、添加python的絕對路徑到環境系統變量裏保存退出

在這裏插入圖片描述

3、安裝pip
解壓pip壓縮包
進入解壓後的目錄
安裝pip
加入系統變量

D:\Python>dir
 驅動器 D 中的卷是 Data
 卷的序列號是 4662-8122

 D:\Python 的目錄

...
2018/08/10  12:01         1,197,370 pip-9.0.1.tar.gz
...

D:\Python>tar xf pip-9.0.1.tar.gz

D:\Python>cd pip-9.0.1

D:\Python\pip-9.0.1>dir
...
2016/11/07  02:49             2,934 setup.py
...

D:\Python\pip-9.0.1>python setup.py install
...
...
...
Installed d:\python\lib\site-packages\pip-9.0.1-py3.8.egg
Processing dependencies for pip==9.0.1
Finished processing dependencies for pip==9.0.1

找到pip安裝位置
在這裏插入圖片描述
加入環境變量
在這裏插入圖片描述

安裝方式一
C:\Users\Jack>pip

Usage:
  pip <command> [options]

Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.
  ...............
  ............
  安裝方式二:
  D:\Python>python pip-20.1.1-py2.py3-none-any.whl/pip install pip-20.1.1-py2.py3-none-any.whl

pip安裝完成啦!

二、安裝Pygame

在這裏插入圖片描述
查看自己python版本我是3.8版本所以下載3.8版本,先考慮第一個下載,安裝失敗的話下第二個

2、移動到python安裝目錄
在這裏插入圖片描述
3、用pip進行安裝pygame

	D:\Python>dir
...
...
2020/06/26  17:42         4,424,256 pygame-1.9.6-cp38-cp38-win32.whl
...
...

D:\Python>D:\Python>pip install pygame-1.9.6-cp38-cp38-win32.whl
Processing d:\python\pygame-1.9.6-cp38-cp38-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.6

pygame安裝成功!
趕快去一起做遊戲吧!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章