0

我有 Windows 8、python 3.5 和 Django 版本 1.8.2

正如 Django 文档中所建议的,我尝试使用以下代码创建超级用户:

python manage.py createsuperuser

当我输入上述命令时,它提示我输入用户名,当我输入用户名时它提示我输入电子邮件,当我输入电子邮件地址而不是提示输入密码时,它显示以下错误。

G:\djangblog\mysite>python manage.py createsuperuser

Username (leave blank to use 'saphal'): admin

Email address: local@admin.com
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "E:\software_installed\python\lib\site-packages\django\core\management\__
init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "E:\software_installed\python\lib\site-packages\django\core\management\__
init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "E:\software_installed\python\lib\site-packages\django\core\management\ba
se.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "E:\software_installed\python\lib\site-packages\django\contrib\auth\manag
ement\commands\createsuperuser.py", line 50, in execute
    return super(Command, self).execute(*args, **options)
  File "E:\software_installed\python\lib\site-packages\django\core\management\ba
se.py", line 441, in execute
    output = self.handle(*args, **options)
  File "E:\software_installed\python\lib\site-packages\django\contrib\auth\manag
ement\commands\createsuperuser.py", line 124, in handle
    password = getpass.getpass()
  File "E:\software_installed\python\lib\getpass.py", line 104, in win_getpass
    msvcrt.putwch(c)
AttributeError: module 'msvcrt' has no attribute 'putwch'

*我在 E 盘上安装了 python,在 G 盘上有我的工作文件夹。

4

1 回答 1

2

这是Python 中的一个已知错误并已解决。

您可以升级到最新的 3.5 版本;或降级到 3.4.3(推荐版本)。

于 2015-06-07T08:11:36.087 回答