python3.6 for pygame安裝
首先下載好文件:
pygame下載網址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
找到pygame-1.9.2b8-cp36-cp36m-win_amd64.whl
在文件路徑中cmd,輸入:python -m pip install --user pygame-1.9.2b8-cp36-cp36m-win_amd64.whl
正常情況下一般都能安裝成功
但是當我這麽安裝時,總提示,報錯:*** is not a supported wheel on this platform
解決方法:
win+r進入cmd,輸入python按enter鍵再輸入import pip按enter鍵再輸入print(pip.pep425tags.get_supported())
實際操作代碼顯示如下:
C:\Python35\Scripts>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> print(pip.pep425tags.get_supported())
[(‘cp35‘, ‘none‘, ‘win_amd64
any‘), (‘cp3‘, ‘none‘, ‘any‘), (‘cp34‘, ‘none‘, ‘any‘), (‘cp33‘, ‘none‘, ‘any‘),
(‘cp32‘, ‘none‘, ‘any‘), (‘cp31‘, ‘none‘, ‘any‘), (‘cp30‘, ‘none‘, ‘any‘), (‘py
35‘, ‘none‘, ‘any‘), (‘py3‘, ‘none‘, ‘any‘), (‘py34‘, ‘none‘, ‘any‘), (‘py33‘, ‘
none‘, ‘any‘), (‘py32‘, ‘none‘, ‘any‘), (‘py31‘, ‘none‘, ‘any‘), (‘py30‘, ‘none‘
, ‘any‘)]
>>>
從這可以發現下載的文件格式是不支持的,版本也不支持,所以重新下載文件:下載版本35的:
pygame-1.9.3-cp35-cp35m-win_amd64.whl
然後再改格式,把上面的文件格式改成:pygame-1.9.3-cp35-none-win_amd64.whl
然後再到文件路徑中cmd輸入:python -m pip install --user pygame-1.9.3-cp35-none-win_amd64.whl 按enter鍵,到這裏就安裝完成了。
檢查是否安裝成功:在python中輸入:
import pygame
print(pygame.ver)
按F5刷新鍵,在python shell中會顯示pygame的版本:1.9.3
python3.6 for pygame安裝