无法在Python 3.4上安装64位Pygame [英] Unable to install 64-bit Pygame on Python 3.4
问题描述
我安装了带有pip的64位python 3.4.我想安装pygame,我知道他们网站上的32位版本不适用于我的python版本.因此,我从此处(pygame ‑1.9.2a0‑cp34‑none‑win_amd64.whl).我将包重命名为pygame.whl
,并尝试在命令行上使用pip进行安装,但它给了我这个错误;
I have 64-bit python 3.4 installed, which comes with pip. 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. So I downloaded the 64-bit python 3.4 pygame package from here (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;
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
所以我尝试使用--allow-external
选项,但是它给了我一个不同的错误,并要求我提供一个需求文件.我环顾四周,发现我可能需要尝试使用--pre
选项,但是无论如何,它都会给我与上述完全相同的错误.如何安装该软件包?
So I tried using the --allow-external
option, but it gave me a different error and asked me to provide a requirements file. 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. How can I install the package?
推荐答案
您未能安装.whl
软件包的最可能原因是您键入
The most likely reason you failed to install the .whl
package is that you typed
pip install pygame
在命令提示符下,而不是切换到存储重命名的pygame.whl
并运行的目录
at the command prompt, instead of switching to the directory where you stored your renamed pygame.whl
and running
pip install pygame.whl
pip
要求您提供要安装的文件的全名.
pip
requires that you give the full name of the file being installed.
您收到的错误消息表明您运行了第一个命令,并且pip
在PyPI中寻找pygame
(不存在). --allow-external
命令将允许您指定可以找到源文件或.whl
文件的远程位置.
The error message you got indicates that you ran the first command, and pip
was looking in PyPI for pygame
(which isn't there). The --allow-external
command would have allowed you to specify a remote location where a source file or .whl
file could be found.
将来,我建议不重命名从链接到的(非常出色的)站点下载的文件,这样当您尝试安装它们时,您会确定,您正在运行正确的命令.请记住,您始终可以在命令行上使用 Tab 来完成文件名.
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.
这篇关于无法在Python 3.4上安装64位Pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!