首页 > 解决方案 > pygame 看起来像一个文件名,但该文件不存在

问题描述

我决定尝试安装 pygame 并遇到了这个问题:

Requirement 'pygame-1.9.3-cp37-cp37m-win32.whl' looks like a filename, but the file does not exist
pygame-1.9.3-cp37-cp37m-win32.whl is not a supported wheel on this platform.

到目前为止一切正常,我非常接近安装 pygame。这也是我输入的内容:

pip install pygame-1.9.3-cp37-cp37m-win32.whl

标签: pythonpygame

解决方案


您通常使用 pip 之类的工具来安装轮子。如果这是用于托管在 PyPI 上的项目,则将其留给工具来发现和下载文件。为此,您需要安装 wheel 包:

Pip install wheel

然后,您可以告诉 pip 安装项目(如果可用,它将下载轮子),或者直接安装轮子文件:

pip install project_name  # discover, download and install
pip install wheel_file.whl  # directly install the wheel

wheel 模块一旦安装,也可以从命令行运行,您可以使用它来安装已经下载的轮子: python -m wheel install wheel_file.whl 另请参阅轮子项目文档。


推荐阅读