gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 04:40:21 28 4
gpt4 key购买 nike

我正在尝试使用 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 实用程序?

最佳答案

我缺少 common-passwords.txt.gz。

在这里找到一个副本:http://pkgs.fedoraproject.org/repo/pkgs/cracklib/common-passwords.txt.gz/5e35a78582c233f8b703f1dabf264788/

安装并将其复制到路径“/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/”并且它有效。

关于python - 在Cygwin中使用Python的startapp时没有这样的文件或目录错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30815858/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com