• [问题记录]cocos的lua绑定安装pyyaml报错


    描述:按照readme中的文档操作报错,提示python2.7没有安装,但是确实已经安装了,而且也设置环境变量成功了。

    解决:

    在D盘新建register.py的文件,内容如下:

    #   
    # script to register Python 2.0 or later for use with win32all   
    # and other extensions that require Python registry settings   
    #   
    # written by Joakim Loew for Secret Labs AB / PythonWare   
    #   
    # source:   
    # http://www.pythonware.com/products/works/articles/regpy20.htm   
    #   
    # modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html   
       
    import sys  
       
    from _winreg import *  
       
    # tweak as necessary   
    version = sys.version[:3]  
    installpath = sys.prefix  
       
    regpath = "SOFTWARE\Python\Pythoncore\%s\" % (version)  
    installkey = "InstallPath"  
    pythonkey = "PythonPath"  
    pythonpath = "%s;%s\Lib\;%s\DLLs\" % (  
        installpath, installpath, installpath  
    )  
       
    def RegisterPy():  
        try:  
            reg = OpenKey(HKEY_CURRENT_USER, regpath)  
        except EnvironmentError as e:  
            try:  
                reg = CreateKey(HKEY_CURRENT_USER, regpath)  
                SetValue(reg, installkey, REG_SZ, installpath)  
                SetValue(reg, pythonkey, REG_SZ, pythonpath)  
                CloseKey(reg)  
            except:  
                print "*** Unable to register!"  
                return  
            print "--- Python", version, "is now registered!"  
            return  
        if (QueryValue(reg, installkey) == installpath and  
            QueryValue(reg, pythonkey) == pythonpath):  
            CloseKey(reg)  
            print "=== Python", version, "is already registered!"  
            return  
        CloseKey(reg)  
        print "*** Unable to register!"  
        print "*** You probably have another Python installation!"  
       
    if __name__ == "__main__":  
        RegisterPy()  

    然后运行这个python文件。

    参考:http://blog.csdn.net/seven_zhao/article/details/16939053即可解决

    原因:未知???

  • 相关阅读:
    列表的排序和统计。
    pyoo6 列表 004
    py005 列表 03
    py004列表02
    py 003 列表01
    py。002 字符串(str)
    py_001 运算符
    【python--字典】 字典的嵌套
    【python--字典】 字典的增删改查
    【python--字典】 字典的有效性
  • 原文地址:https://www.cnblogs.com/pk-run/p/4224817.html
Copyright © 2020-2023  润新知