簡體   English   中英

使用 pip install 安裝 pygame 時遇到問題

[英]Trouble installing pygame using pip install

我試過: c:/python34/scripts/pip install http://bitbucket.org/pygame/pygame

並收到此錯誤:

Cannot unpack file C:\Users\Marius\AppData\Local\Temp\pip-b60d5tho-unpack\pygame 
(downloaded from C:\Users\Marius\AppData\Local\Temp\pip-rqmpq4tz-build, conte
nt-type: text/html; charset=utf-8); cannot detect archive format
  Cannot determine archive format of C:\Users\Marius\AppData\Local\Temp\pip-rqmp
q4tz-build

如果有人有任何解決方案,請隨時分享! 我也試過pip install --allow-unverified ,但這也給了我一個錯誤。

這是唯一對我有用的方法。

pip install pygame==1.9.1release --allow-external pygame --allow-unverified pygame

-

這些是導致我執行此命令的步驟(我放了它們以便人們容易找到):

$ pip install pygame
Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pygame to allow).
  No distributions at all found for pygame

然后,建議,我允許外部:

$ pip install pygame --allow-external pygame
Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some insecure and unverifiable files were ignored (use --allow-unverified pygame to allow).
  No distributions at all found for pygame

因此,我也允許無法驗證的內容:

$ pip install pygame --allow-external pygame --allow-unverified pygame
Collecting pygame
  pygame is potentially insecure and unverifiable.
  HTTP error 400 while getting http://www.pygame.org/../../ftp/pygame-1.6.2.tar.bz2 (from http://www.pygame.org/download.shtml)
  Could not install requirement pygame because of error 400 Client Error: Bad Request
  Could not install requirement pygame because of HTTP error 400 Client Error: Bad Request for URL http://www.pygame.org/../../ftp/pygame-1.6.2.tar.bz2 (from http://www.pygame.org/download.shtml)

因此,在訪問http://www.pygame.org/download.shtml之后 ,我想到了添加版本號(1.9.1release是當前穩定的版本)。

-

希望能幫助到你。

如果您在安裝pygame時遇到麻煩,關於缺少Visual Studio 10+的錯誤。 我有答案:問題不是關於是否擁有Visual Studio,因為我嘗試了很多版本,但是沒有用。 問題是文件:在tar.gz.whl之間,這是解決方案:

1)下載文件:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

轉到此處下載pygame版本,注意有關x64或x86和python版本的信息。 我的系統是x64,python是3.4,所以我選擇: pygame-1.9.2a0-cp34-none-win_amd64.whl

2)將其放在一些安裝位置:

我將其放在“ C:”中,因此打開cmd:並鍵入:cd C:\\(這是將位置更改為C :)

3)安裝

pip install C:\pygame-1.9.2a0-cp34-none-win_amd64.whl

完成!

我意識到兼容的Pygame版本只是損壞或損壞。 因此,我必須安裝以前版本的python才能運行Pygame。 實際上,這很好,因為大多數模塊尚未更新為與Python 3.4兼容,因此它只為我提供了更多選擇。

我自己遇到了這個錯誤(在使用 v3.10.0 時),然后我卸載了最新版本並安裝了舊版本的 python(v3.9.7) 並解決了這個問題。 希望這對你也有用。 老實說,除非他們從 python3 跳轉到 python4,否則修復程序中沒有太多變化。 所以你不需要為了最新性而更新python

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM