Question

I have just done a fresh install of Python 2.7 and Django 1.6.5.

Entering into python in the terminal and using import Django and django.VERSION yields:

(1, 6, 5, 'final', 0)

But when I attempt to run python django-admin.py startproject myproject, I get the following:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'django-admin.py': [Errno 2] No such file or directory

There doesn't seem to be a ton of info available on how to rectify this in a Mac, and the Django docs don't offer much assistance other that "maybe try a symlink".

Can someone help me solve this error?

EDIT: Here is the result of running echo $PATH

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Was it helpful?

Solution

Try running without python

django-admin.py startproject myproject

Explanation: It's because django-admin.py is added in one of the bin folders. Also, python expects a file path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top