想要安裝pygame,利用這個(gè)包來(lái)畫一些幾何圖形:
于是在命令行中打出下面這行命令,想通過(guò)pip的豆瓣鏡像來(lái)幫我把這個(gè)包下載并安裝好:
pip install pygame-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
結(jié)果失敗了,錯(cuò)誤提示如下
Cannot unpack file
c:\users\a\appdata\local\temp\pip-rvf6ni-unpack\simple (dow
nloaded from c:\users\a\appdata\local\temp\pip-xc7jae-build, content-type:
text/
html; charset=utf-8); cannot detect archive format
Cannot determine archive format of
c:\users\a\appdata\local\temp\pip-xc7jae-build
以為是網(wǎng)站的問(wèn)題,換了清華的網(wǎng)站:
pip install pygame-i https://pypi.tuna.tsinghua.edu.cn/simple/
?還是不行,不知道為什么。到目前也沒(méi)有解決,如果有大佬知道原因,請(qǐng)告知,謝謝。
?
只好用笨辦法解決:下載pygame-1.9.3-cp27-cp27m-win32.whl,放到C:\Python27\Scripts下,再打開cmd,顯示:c: \ user\lvyq,這時(shí)候,連續(xù)兩次敲入cd..,退回C盤根目錄。見下圖:
?

再在后面敲入cd C:\Python27\Scripts,進(jìn)入此目錄后,再用pip安裝,即pip install pygame-1.9.3-cp27-cp27m-win32.whl,然后顯示成功
?
?