【问题标题】:How to install pygame on msys2?如何在 msys2 上安装 pygame?
【发布时间】:2019-05-07 15:59:43
【问题描述】:

我想在 msys2 上使用 pip for python2.7 安装 pygame 1.9.6。问题是当我尝试使用“pip install pygame”安装它时出现错误。

这是错误:

Processing d:/msys64/home/desolaser/pygame-1.9.6.tar.gz
    Complete output from command python setup.py egg_info:


    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using WINDOWS configuration...


    Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:/users/desola~1/appdata/local/temp/pip-req-build-tn9xwt/setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "buildconfig/config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "buildconfig/config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "buildconfig/download_win_prebuilt.py", line 303, in ask
        '\nDownload prebuilts to "%s" and copy to %s? [Y/n]' % (download_dir, dest_str))
    EOFError: EOF when reading a line

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:/users/desola~1/appdata/local/temp/pip-req-build-tn9xwt/

我尝试在 python3 中使用“pip3 install pygame”做同样的事情,但我得到了同样的错误。 可以在msys2上安装pygame吗?

【问题讨论】:

    标签: python pip pygame msys2


    【解决方案1】:

    我也有这个错误。您可以从 wheel 文件中安装它。

    首先使用 pip 将轮子安装到 python 中。

    pip 安装轮子

    转到此页面 https://pypi.org/project/pygame/#files 或者 https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

    他们为 32 位和 64 位的 pygame 构建了 wheel 文件,具体取决于您安装的 python 类型。因此,对于 32 位 python 版本 3.7,在 Windows 上,您将下载 pygame-1.9.6-cp37-cp37-win32.whl

    然后安装wheel文件

    pip install C:/some-dir/pygame-1.9.6-cp37-cp37-win32.whl

    【讨论】:

    • 你能补充一点吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-07
    • 1970-01-01
    • 2019-06-30
    • 2018-03-10
    • 2018-11-19
    • 2013-10-21
    • 1970-01-01
    相关资源
    最近更新 更多