1

Trying to create the first project. First got the below error when I ran,

django-admin.py startproject mysite

then I tried,

django-admin.py

Also symlinked the path and its in the path. But I still get the error.

. . .
File "/Users/Satha/django-trunk/django/bin/django-admin.py", line 7, in execfile(file) File "/Users/Satha/django-trunk/django/bin/django-admin.py", line 4, in from pkg_resources import require; require('Django==1.5.dev20120720114244') File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 546, in resolve requirements = list(requirements)[::-1] # set up the stack File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2438, in parse_requirements yield Requirement(project_name, specs, extras) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2465, in init self.unsafe_name, project_name = project_name, safe_name(project_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1113, in safe_name return re.sub('[^A-Za-z0-9.]+', '-', name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 151, in sub File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 231, in _compile RuntimeError: maximum recursion depth exceeded while calling a Python object

4

1 回答 1

1

除非您有某些特定原因,否则您可能不应该使用不稳定的 django (1.5) 开发版本。尽管我不确定为什么即使使用 dev 分支也会遇到问题,因为它对我来说安装得很好,并且同样容易地创建一个项目。

我建议尝试首先删除开发版本,然后通过安装 djangoeasy_installpip将获得 v1.4。 安装说明在这里

如果在安装 django 1.4 之后,如果你仍然有这个问题,尝试创建一个virtualenv,它将在一个目录中创建一个隔离环境,然后在其中安装 django。

于 2012-07-21T05:42:44.917 回答