cocos installation: AttributeError: 'dict' object has no attribute 'has_key'
cocos installation: AttributeError: 'dict' object has no attribute 'has_key'
我正在学习 mac 上的教程。我已正确设置所有 env 路径,但是当我开始一个新项目时出现错误。
我安装了 2 个 pythons 3.4 和 2.7;这是我遇到问题的原因吗?
我写了:
cocos$ cocos new HelloWorld -p com.myname.HelloWorld -l cpp -d / Users/dev/cocos/cocosProjects/HelloWorld
我收到以下错误:
回溯(最后一次调用):
文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py”,第 904 行,位于
如果不是 _check_python_version():
文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py”,第 868 行,在 _check_python_version 中
打印(MultiLanguage.get_string('COCOS_PYTHON_VERSION_TIP_FMT') % (major_ver, minor_ver))
文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 52 行,在 get_string 中
fmt = cls.get_instance().get_current_string(键)
文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 46 行,在 get_instance 中
cls.instance = 多语言()
文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 100 行,在 init 中
如果 self.cfg_info.has_key(cur_lang_key):
AttributeError: 'dict' 对象没有属性 'has_key'
我再次安装了python2.7.11,然后我就可以使用cocos new 来构建一个新项目了;将 python 别名为 python2 之前没有用;我仍然可以访问其他应用程序的 3.4 版本,但 2.7 是我的默认版本,这是之前的问题。
希望对有类似问题的朋友有所帮助
谢谢大家的观看
我正在学习 mac 上的教程。我已正确设置所有 env 路径,但是当我开始一个新项目时出现错误。 我安装了 2 个 pythons 3.4 和 2.7;这是我遇到问题的原因吗?
我写了:
cocos$ cocos new HelloWorld -p com.myname.HelloWorld -l cpp -d / Users/dev/cocos/cocosProjects/HelloWorld
我收到以下错误:
回溯(最后一次调用): 文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py”,第 904 行,位于 如果不是 _check_python_version(): 文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py”,第 868 行,在 _check_python_version 中 打印(MultiLanguage.get_string('COCOS_PYTHON_VERSION_TIP_FMT') % (major_ver, minor_ver)) 文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 52 行,在 get_string 中 fmt = cls.get_instance().get_current_string(键) 文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 46 行,在 get_instance 中 cls.instance = 多语言() 文件“/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py”,第 100 行,在 init 中 如果 self.cfg_info.has_key(cur_lang_key): AttributeError: 'dict' 对象没有属性 'has_key'
我再次安装了python2.7.11,然后我就可以使用cocos new 来构建一个新项目了;将 python 别名为 python2 之前没有用;我仍然可以访问其他应用程序的 3.4 版本,但 2.7 是我的默认版本,这是之前的问题。 希望对有类似问题的朋友有所帮助
谢谢大家的观看