4

我设法安装了 pip 但是当我使用 pip 安装下载的轮子时,它会打印:

C:\Python34\Scripts\pip install pygame-1.9.2a0-cp34-none-win_amd64.whl
Requirement 'pygame-1.9.2a0-cp34-none-win_amd64.whl' looks like a filename, but the file does not exist
pygame-1.9.2a0-cp34-none-win_amd64.whl is not a supported wheel on this platform

该文件与 pip 位于同一文件夹(脚本)中。

我也尝试过使用该wheel工具:

C:\Python34\Scripts\wheel install pygame-1.9.2a0-cp34-none-win_amd64.whl
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 358, in main
    args.func(args)
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 301, in install_f
    args.wheel_dirs, args.force, args.list_files)
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 202, in install
    raise WheelError("No such wheel file: {}".format(req))
wheel.tool.WheelError: No such wheel file: pygame-1.9.2a0-cp34-none-win_amd64.whl
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\wheel.exe\__main__.py", line 9, in <module>
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 361, in main
    sys.stderr.write(e.message + "\n")
AttributeError: 'WheelError' object has no attribute 'message'

我使用 PowerShell,请帮助!

4

4 回答 4

12

用于使用pip完整路径安装 wheel 文件:

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

如果没有路径,则名称被视为一项要求,而不是已下载的文件。这应该适用于支持您当前 Python 架构的轮文件。您可以通过以下方式验证您的架构:

C:\Python34\python.exe -c "import distutils.util; print(distutils.util.get_platform())"

这应该打印win_amd6。如果它打印出来win32,你有一个 32 位 Python 二进制文件,需要选择一个不同的轮子。

于 2015-01-26T13:12:52.000 回答
2

pip install pygame-1.9.2a0-cp27-none-win_amd64.whl

这在我的计算机上使用 Python2.7.3(64 位)有效,而其他版本无效。

于 2016-01-12T06:48:46.323 回答
1

安装车轮支架pip

pip install wheel

安装下载的轮子:

pip install path/to/pygame-1.9.2a0-cp34-none-win_amd64.whl
于 2015-01-26T13:27:12.233 回答
1

我不得不删除 64 位 python 并安装 32 位版本来解决这个问题。

c:\python34\scripts\pip install c:\users\USER\downloads\pygame-1.9.2a0-cp34-none-win32.whl
Unpacking c:\users\USER\downloads\pygame-1.9.2a0-cp34-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame
Cleaning up...

使用 32 位运行良好 :)

于 2015-02-19T10:32:07.660 回答