python - Pycharm打不开manage.py任务

标签 python django pycharm django-manage.py

在我的一个项目中,我无法打开管理任务控制台。它适用于其他项目,但不适用于此项目。它以前有效,但最近停止了。我尝试使用该项目的旧版本,但它仍然损坏。我收到此错误:

    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/

相关文章:

interpreter - Pycharm是否具有交互式Python解释器?

python - 将 python/django 应用程序部署到 gae

python - 如何在Python中向子列表添加元素?

python - Pandas :替换字符串中的子字符串

python - 如何在 FreeBSD 中打开 PostgreSQL 的 psql 提示符?

python - Django 发出多对多变化的信号

python - PyCharm 类型检查没有按预期工作

python - 在 Python 中使用字典翻译短语

python - 使用 2 位数字与 3 位数字时,django 中的数学结果不正确?

windows - JetBrains PyCharm : Length of PATH is bigger than 8192 bytes