Reputation: 2837
I'm a newbie to Django and am following instructions on getting a project up and running. The instructions I'm following told me to create a project with django-admin.py startproject
and then navigate inside the directory created and try python manage.py help
to make sure that everything was up and running. However, running that command spilled out this error:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/var/lib/python-support/python2.5/django/core/management.py", line 1522, in execute_from_command_line
parser = DjangoOptionParser(usage=get_usage(action_mapping), version=get_version())
File "/var/lib/python-support/python2.5/django/core/management.py", line 1503, in get_usage
available_actions = action_mapping.keys()
AttributeError: 'list' object has no attribute 'keys'
Can someone tell me what's going on? Thanks. This is from a fresh install of django from the Ubuntu repos.
Upvotes: 0
Views: 353
Reputation: 2837
I figured it out. For anyone else who comes across the issue, here's what happened:
It turns out, I had multiple versions of python installed on my system - pip was configured to use python2.7 whereas the default bash python command was configured with python 2.5. So if you come across this issue, check to see which version of python django was installed with and use that version. In my specific case, changing the command to python2.7 manage.py help
made it run fine.
Thanks to those who helped!
Upvotes: 2
Reputation: 309099
You don't say which version of Ubuntu you at running, but since you are running Python 2.5 it is probably very old.
Similarly, the version of Django that you have installed from the repo is probably very old and perhaps unsupported.
I would try an alternative installation method, like pip (with virtualenv for bonus points), so that you get the most recent Django release.
The current Django 1.4 supports Python 2.5, but the next version 1.5 requires Python 2.6.
Upvotes: 2