[英]Can't open file “django-admin.py”: No such file or directory — Mac OSX
I have just done a fresh install of Python 2.7 and Django 1.6.5. 我刚刚完成了Python 2.7和Django 1.6.5的全新安装。
Entering into python in the terminal and using import Django
and django.VERSION
yields: 在终端中输入python并使用import Django
和django.VERSION
产生:
(1, 6, 5, 'final', 0)
But when I attempt to run python django-admin.py startproject myproject
, I get the following: 但是当我尝试运行python django-admin.py startproject myproject
,我得到以下结果:
/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". 似乎没有关于如何在Mac中纠正这一问题的大量信息,并且Django文档除了“可能尝试符号链接”之外没有提供太多帮助。
Can someone help me solve this error? 有人可以帮我解决这个错误吗?
EDIT: Here is the result of running echo $PATH
编辑:这是运行echo $PATH
的结果
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Try running without python
尝试不使用python
运行
django-admin.py startproject myproject
Explanation: It's because django-admin.py
is added in one of the bin folders. 说明:这是因为django-admin.py
被添加到其中一个bin文件夹中。 Also, python
expects a file path. 此外, python
需要一个文件路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.