无法安装pygame [英] Cant install pygame

查看:133
本文介绍了无法安装pygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在使用python和/或pip时遇到了一些问题...

So I've got a bit of an issue with python and/or pip...

Python,当要求使用<$ c在CMD中下载pygame时$ c> py -m pip install -U pygame --user ,给我这个错误:

Python, when asked to download pygame in CMD with py -m pip install -U pygame --user, gives me this error:

    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\gary\AppData\Local\Temp\pip-install-1zalja6w\pygame\setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "C:\Users\gary\AppData\Local\Temp\pip-install-1zalja6w\pygame\buildconfig\config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "C:\Users\gary\AppData\Local\Temp\pip-install-1zalja6w\pygame\buildconfig\config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "C:\Users\gary\AppData\Local\Temp\pip-install-1zalja6w\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
        reply = raw_input(
    EOFError: EOF when reading a line
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

似乎可以很好地下载文件,但是之后不希望继续。我正在运行python 3.8。是的,Python安装在PATH变量中。

It seems to download the files just fine but does NOT like to continue after that. I'm running python 3.8. And yes, Python is installed in the PATH variable.

我觉得这可能是一个非常愚蠢的问题,我只是忽略了一些东西,但似乎找不到任何有用的东西。

I feel like this could be a really stupid issue and I've just overlooked something but I cant seem to find anything that helps.

- --- edit -----

-----edit-----

我已经解决了一些问题-只需下载并使用python 3.7而不是3.8,这似乎更好。

I've worked out a bit of a solution - just download and use python 3.7 instead of 3.8 and that seems to work better.

推荐答案

假设您使用的是具有自动安装导入功能的IDE(例如,PyCharm),则只需设置您的IDE当前对python 3.7.4的解释器,并使用它来安装pygame而不是使用pip。问题与pygame安装与python 3.8不兼容有关,因此可以将您的解释器,角色恢复为python 3.7或等待pygame更新

Assuming you're using an IDE with the ability to automatically install imports (PyCharm for example) you can just set your IDE's current interpreter to python 3.7.4 and use it to install pygame instead of using pip. The problem has something to do with the pygame install not working with python 3.8 so either revert your interpreter, role back to python 3.7 or wait for pygame to get updated

这篇关于无法安装pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆