문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top