In one of my projects , I cannot open manage task console. It works for other projects but not for this one. It worked before, but it stopped recently. I tried using old versions of the project, but its still broken. I get this error:
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'
manage.py should live in the root project folder, so if you cd into C:Users/arpchauh/PycharmProjects/post_blog , you should be able to run the command.
Open the project Settings/Preferences dialog ( Ctrl+Alt+S ) and navigate to the Languages & Frameworks | Django page. Make sure that the checkbox Enable Django support is selected. Apply changes (if any) and close the dialog.
Manage.py in Django is a command-line utility that works similar to the django-admin command. The difference is that it points towards the project's settings.py file. This manage.py utility provides various commands that you must have while working with Django.
update your _utils.py in YOUR_PYCHARM_INSTALLATION_DIR\helpers\pycharm\django_manage_commands_provider\_parser\_utils.py
and changes the code in line 20:
assert isinstance(opt.choices, list), "Choices should be list"
with
assert isinstance(opt.choices, (list, tuple)), "Choices should be list or tuple"
Install version 4.5.3 RC
If you are using a virtual environment, make sure your project interpreter (settings > Project:... > Project Interpreter) points to the python executable in it (e.g., my_virtual_env/bin/python3.4).
If you are using a virtual machine, you also need to have your project interpreter setting point to the python version under your virtual environment under your virtual machine. If you are using Vagrant this is easy, as when you try to add a new interpreter PyCharm lets you select Vagrant, and then browse the VM file system to point to the file you needed.
It looks like a bug in the new manage.py tasks integration of PyCharm 4.5. Please report this issue to the PyCharm's issue tracker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With