Python Can';在mac上创建django(1.11)超级用户
我试图在Mac(10.13.3)上的Python(3.6.4)上用Django(1.11)创建超级用户 输入用户名后,我按Python Can';在mac上创建django(1.11)超级用户,python,django,macos,Python,Django,Macos,我试图在Mac(10.13.3)上的Python(3.6.4)上用Django(1.11)创建超级用户 输入用户名后,我按enter输入不会让我进入下一个输入 $ python manage.py createsuperuser Username (leave blank to use 'neon'): admin^M^M^M^M^M^M^M^M^C^CKeyboardInterrupt The above exception was the direct cause of the follo
enter
<代码>输入不会让我进入下一个输入
$ python manage.py createsuperuser
Username (leave blank to use 'neon'): admin^M^M^M^M^M^M^M^M^C^CKeyboardInterrupt
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 63, in execute
return super(Command, self).execute(*args, **options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 116, in handle
username = self.get_input_data(self.username_field, input_msg, default_username)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 192, in get_input_data
raw_value = input(message)
SystemError: <built-in function input> returned a result with an error set
$python manage.py createsuperuser
用户名(留空使用“neon”):admin^M^M^M^M^M^M^M^M^C^CKeyboardInterrupt
上述异常是以下异常的直接原因:
回溯(最近一次呼叫最后一次):
文件“manage.py”,第22行,在
从命令行(sys.argv)执行命令
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/core/management/__init_uuuuuu.py”,第363行,从命令行执行
utility.execute()
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/core/management/_____________.py”,第355行,在执行中
self.fetch_命令(子命令)。从_argv(self.argv)运行_
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/core/management/base.py”,第283行,在运行中,来自
self.execute(*args,**cmd_选项)
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/contrib/auth/management/commands/createsuperuser.py”,执行中的第63行
返回super(命令,self).execute(*args,**选项)
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/core/management/base.py”,第330行,执行
输出=self.handle(*args,**选项)
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/contrib/auth/management/commands/createsuperuser.py”,第116行,在句柄中
username=self.get\u input\u数据(self.username\u字段,input\u msg,默认\u用户名)
文件“/Users/neon/workspace/jp/lib/python3.6/site packages/Django-1.11-py3.6.egg/Django/contrib/auth/management/commands/createsuperuser.py”,第192行,在get_输入_数据中
原始值=输入(消息)
SystemError:返回了一个带有错误集的结果
如评论中所述,新终端中的ctrl+j和运行命令都起作用。终端或输入有问题。尝试打开一个新的终端,或者重新启动机器并检查键盘是否正常也可能会有帮助。对于用户名,您的输入是admin^M^M^M^M^M^M^M^C
,并且在最后出现键盘中断。如果您因为某种原因看到^M,请注意我总是使用Ctrl+J
而不是Enter
谢谢,ctrl+j
&在新终端中尝试CMD都有效。