在Cygwin中使用Python的startapp时没有这样的文件或目录错误

时间:2015-06-13 06:42:48

标签: python django cygwin

我正在尝试使用Python。我在Cygwin中安装了Python 2.7,并且还安装了Django 1.9。

我已经开始了一个项目,我正在创建我的第一个应用程序但是我得到了这个堆栈跟踪:

python manage.py startapp newsFeed
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/manage                                                                                                                ment/__init__.py", line 330, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/manage                                                                                                                ment/__init__.py", line 304, in execute
    django.setup()
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/adm                                                                                                                in/__init__.py", line 24, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/utils/modul                                                                                                                e_loading.py", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/admin.py", line 7, in <module>
    from django.contrib.auth.forms import (
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/forms.py", line 259, in <module>
    class SetPasswordForm(forms.Form):
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/forms.py", line 269, in SetPasswordForm
    help_text=password_validation.password_validators_help_text_html())
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/aut                                                                                                                h/password_validation.py", line 84, in password_validators_help_text_html
    help_texts = password_validators_help_texts(password_validators)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/aut                                                                                                                h/password_validation.py", line 73, in password_validators_help_texts
    password_validators = get_default_password_validators()
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/utils/lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/aut                                                                                                                h/password_validation.py", line 20, in get_default_password_validators
    return get_password_validators(settings.AUTH_PASSWORD_VALIDATORS)
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/aut                                                                                                                h/password_validation.py", line 31, in get_password_validators
    validators.append(klass(**validator.get('OPTIONS', {})))
  File "/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/aut                                                                                                                h/password_validation.py", line 154, in __init__
    common_passwords_lines = open(password_list_path).readlines()
IOError: [Errno 2] No such file or directory: u'/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/common-passwords.txt.gz'

我已经浏览了Google和Stack Overflow,但我无法找到我需要的答案。

我是否需要安装另一个Python软件包,或者我错过了一个Cygwin实用程序?

1 个答案:

答案 0 :(得分:2)

我错过了common-passwords.txt.gz。

在此处找到一份副本:http://pkgs.fedoraproject.org/repo/pkgs/cracklib/common-passwords.txt.gz/5e35a78582c233f8b703f1dabf264788/

安装并复制到路径&#39; /usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth /'它起作用了。