加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python-3.x – Python 3.6.0的Pygame安装

发布时间:2020-12-20 11:56:48 所属栏目:Python 来源:网络整理
导读:我在Pygame 1.9.2中使用 Python 3.5.2,一切正常.然后我决定尝试使用全新安装最近发布的Python 3.6.0,但是当我尝试使用以下方法重新安装Pygame时: pip install pygame 它返回以下内容: Collecting pygame Downloading pygame-1.9.2.tar.gz (3.0MB) 100% |█
我在Pygame 1.9.2中使用 Python 3.5.2,一切正常.然后我决定尝试使用全新安装最近发布的Python 3.6.0,但是当我尝试使用以下方法重新安装Pygame时:

pip install pygame

它返回以下内容:

Collecting pygame
  Downloading pygame-1.9.2.tar.gz (3.0MB)
    100% |████████████████████████████████| 3.0MB 292kB/s
    Complete output from command python setup.py egg_info:


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

    Path for SDL not found.
    Too bad that is a requirement! Hand-fix the "Setup"
    Path for FONT not found.
    Path for IMAGE not found.
    Path for MIXER not found.
    Path for PNG not found.
    Path for JPEG not found.
    Path for PORTMIDI not found.
    Path for COPYLIB_tiff not found.
    Path for COPYLIB_z not found.
    Path for COPYLIB_vorbis not found.
    Path for COPYLIB_ogg not found.

    If you get compiler errors during install,doublecheck
    the compiler flags in the "Setup" file.


    Continuing With "setup.py"
    Error with the "Setup" file,perhaps make a clean copy from "Setup.in".
    Traceback (most recent call last):
      File "<string>",line 1,in <module>
      File "C:UsersrodriAppDataLocalTemppip-build-328x7lmepygamesetup.py",line 165,in <module>
        extensions = read_setup_file('Setup')
      File "c:pythonlibdistutilsextension.py",line 171,in read_setup_file
        line = expand_makefile_vars(line,vars)
      File "c:pythonlibdistutilssysconfig.py",line 410,in expand_makefile_vars
        s = s[0:beg] + vars.get(m.group(1)) + s[end:]
    TypeError: must be str,not NoneType

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:UsersrodriAppDataLocalTemppip-build-328x7lmepygame

解决方法

我通过使用命令解决了这个问题:

pip install wheel

然后从here下载了pygame-1.9.2-cp36-cp36m-win_amd64.whl(我使用的是64位Windows).我将文件复制到Python文件夹然后使用

pip install pygame?1.9.2?cp36?cp36m?win_amd64.whl

它起作用了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读