0

I'm new to Django and Python. Running through the Django Polls app and have errors right away:

(rrdj) Jeffreys-MBP:rrdj usr$ python manage.py startapp rr
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
  File "/Users/usr/.pyenv/versions/rrdj/lib/python3.5/site-packages/django/core/management/__init__.py", line 54
    except ImportError,e:
                      ^
SyntaxError: invalid syntax

I went through most of this tutorial previously and it worked, but on native python 2.7.10, not python 3.5. I finally got pyenv installed, created a virtual environment that works, and installed a new project. Verified that it is Python 3.5. I've tried activating and deactivating pyenv - when I run that, it makes no difference. Django is installed, the versions all seem to match...

I know this is an environment issue, I'm just not sure how to find it.

Jeff Ericson
  • 61
  • 1
  • 9
  • 2
    what version of django is this using? – awwester Feb 03 '16 at 13:45
  • I was trying to install neo4j to experiment with that. Turns out that when you do pip install neo4django, it uninstalls django 1.9 and installs django 1.4, which screws everything up. Went back to look at the documentation and it doesn't explicitly tell you it's doing that. Guess I'll just work with the neo4j rest servers instead. Thanks again. – Jeff Ericson Feb 03 '16 at 17:29

1 Answers1

0

Looks like you might need to reinstall Django as that syntax is for python 2.7. Seems like maybe an old version of Django, what version are you using?

awwester
  • 9,623
  • 13
  • 45
  • 72
  • 1
    I swear I was using 1.9.1, but I checked anyway, and it said 1.4x. Uninstalled and reinstalled both in pyenv and outside. I should have double-checked that too. Thank you! – Jeff Ericson Feb 03 '16 at 14:02
  • @JeffEricson no problem, I went back to 1.6 looking at the source code but didn't find exactly where your error was. Should have gone back to 1.4 and then would have had a definitive answer ;) – awwester Feb 03 '16 at 21:35