简体   繁体   English

无法在Python 3.4上安装64位Pygame

[英]Unable to install 64-bit Pygame on Python 3.4

I have 64-bit python 3.4 installed, which comes with pip. 我安装了pip随附的64位python 3.4。 I wanted to install pygame, and I know that the 32 bit version that they have on their site wouldn't work with my version of python. 我想安装pygame,我知道他们网站上的32位版本不适用于我的python版本。 So I downloaded the 64-bit python 3.4 pygame package from here (pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl). 因此,我从此处下载了64位python 3.4 pygame软件包(pygame‑1.9.2a0‑cp34‑none‑win_amd64.whl)。 I renamed the package to pygame.whl and tried to use pip on the command line to install it, but it gave me this error; 我将包重命名为pygame.whl并尝试在命令行上使用pip进行安装,但这给了我这个错误;

Collecting pygame
Could not find a version that satisfies the requirement pygame (from versions:
)
Some externally hosted files were ignored as access to them may be unreliable
(use --allow-external pygame to allow).
No matching distribution found for pygame

So I tried using the --allow-external option, but it gave me a different error and asked me to provide a requirements file. 因此,我尝试使用--allow-external选项,但它给了我一个不同的错误,并要求我提供需求文件。 I looked around, and found that I might need to try using the --pre option, but it gave me the exact same error as above regardless. 我环顾四周,发现我可能需要尝试使用--pre选项,但是--pre它都会给我与上面完全相同的错误。 How can I install the package? 如何安装软件包?

The most likely reason you failed to install the .whl package is that you typed 您未能安装.whl软件包的最可能原因是您键入了

pip install pygame

at the command prompt, instead of switching to the directory where you stored your renamed pygame.whl and running 在命令提示符下,而不是切换到存储重命名的pygame.whl并运行的目录

pip install pygame.whl

pip requires that you give the full name of the file being installed. pip要求您提供要安装的文件的全名

The error message you got indicates that you ran the first command, and pip was looking in PyPI for pygame (which isn't there). 您收到的错误消息表明您运行了第一个命令,并且pip在PyPI中寻找pygame (不存在)。 The --allow-external command would have allowed you to specify a remote location where a source file or .whl file could be found. --allow-external命令将允许您指定可以在其中找到源文件或.whl文件的远程位置。

In the future, I'd recommand not renaming the files downloaded from the (quite excellent) site you linked to, so that when you try to install them you're sure you're running the right command. 将来,我建议不要重命名从链接到的(非常出色的)站点下载的文件,这样当您尝试安装它们时,请确保您运行的命令正确。 Remember, you can always use Tab to complete file names on the command line. 请记住,您始终可以在命令行上使用Tab来完成文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM