在我的一个项目中,我无法打开管理任务控制台。它适用于其他项目,但不适用于此项目。它以前有效,但最近停止了。我尝试使用该项目的旧版本,但它仍然损坏。我收到此错误:
Failed to get real commands on module "Visdjango": python process died with code 1: Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.1\helpers\pycharm\manage_tasks_provider.py", line 22, in <module>
parser.report_data(dumper)
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.1\helpers\pycharm\django_manage_commands_provider\_parser\parser.py", line 40, in report_data
module_to_use.process_command(dumper, command, command.create_parser("", command_name))
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.1\helpers\pycharm\django_manage_commands_provider\_parser\_optparse.py", line 23, in process_command
dumper.set_arguments(command.args)
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.1\helpers\pycharm\django_manage_commands_provider\_xml.py", line 95, in set_arguments
self.__command_element.setAttribute("args", VersionAgnosticUtils().to_unicode(command_args_text))
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.1\helpers\pycharm\utils.py", line 36, in to_unicode
return unicode(obj.decode("utf-8"))
AttributeError: 'list' object has no attribute 'decode'
最佳答案
更新 YOUR_PYCHARM_INSTALLATION_DIR\helpers\pycharm\django_manage_commands_provider\_parser\_utils.py
中的 _utils.py
并修改第20行的代码:
assert isinstance(opt.choices, list), "Choices should be list"
与
assert isinstance(opt.choices, (list, tuple)), "Choices should be list or tuple"
关于python - Pycharm打不开manage.py任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30403806/