Reputation: 1504
Got this error on installing Python as usual on my workstation @ work (Windows environment):
Traceback (most recent call last):
File "C:\Python27\Scripts\django-admin.py", line 4, in <module>
import pkg_resources
File "C:\Python27\Lib\site-packages\pkg_resources.py", line 29
def _bypass_ensure_directory(name, mode=0777):
^
SyntaxError: invalid token
I've been unable to find anything on searchengines, only some Debian related bugs.
I've tried reinstalling python-setuptools both via easy_install and the MSI installers (setuptools-0.6c11-py2.7).
Upvotes: 2
Views: 1412
Reputation: 100856
You are somehow running django-admin.py
under Python 3. The octal literal syntax was changed in Python 3. The error you get is Python 3 complaining about Python 2.x octal literal syntax.
How do you invoke django-admin.py
? You are somehow invoking django-admin.py
in such a way that Python 3 is used.
Perhaps you do c:\whatever> django-admin.py ...
?
In that case, I suggest try instead:
c:\whatever> c:\Python27\python.exe c:\Python27\Scripts\django-admin.py ...
The problem is probably that you have installed Python 3 after you installed Python 2. The Windows Python installer associates .py files for execution with the installed version.
Upvotes: 2