在 Cygwin 中使用 Python 的 startapp 时没有这样的文件或目录错误
No such file or directory error when using Python's startapp in 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 实用程序?
我错过了常见的-passwords.txt.gz。
已安装并将其复制到路径“/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/”并且有效。
我正在尝试 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 实用程序?
我错过了常见的-passwords.txt.gz。
已安装并将其复制到路径“/usr/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/contrib/auth/”并且有效。