Windows 10上使用Django的runserver出错

时间:2016-04-20 21:02:28

标签: django windows-10 otree

我正在使用python 3.5和Windows 10,但使用Windows 8时遇到了同样的问题,这是我在尝试运行服务器时得到的回溯:

  

追踪(最近一次通话):     文件" C:\ Users \ noabendor87 \ documents \ otree \ manage.py",第10行,在       execute_from_command_line(sys.argv,script_file = file )     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ otree \ management \ cli.py",line   177,在execute_from_command_line中       utility.execute()     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management__init__   执行中.py",第346行       self.fetch_command(子命令).run_from_argv(self.argv)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management \ base.py"   ,第394行,在run_from_argv中       self.execute(* args,** cmd_options)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management \ commands   \ runserver.py",第49行,执行中       super(Command,self).execute(* args,** options)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management \ base.py"   ,第445行,执行中       output = self.handle(* args,** options)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management \ commands   \ runserver.py",第88行,在句柄中       self.run(**选项)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ core \ management \ commands   \ runserver.py",第97行,在运行中       autoreload.main(self.inner_run,None,options)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ utils \ autoreload.py",li   ne 336,主要       重新加载器(wrapped_main_func,args,kwargs)     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ utils \ autoreload.py",li   ne 307,在python_reloader中       exit_code = restart_with_reloader()     文件" c:\ users \ noabendor87 \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages \ django \ utils \ autoreload.py",li   ne 293,在restart_with_reloader中       exit_code = os.spawnve(os.P_WAIT,sys.executable,args,new_environ)   UnicodeEncodeError:' mbcs'编解码器不能编码位置0-1的字符:无效字符

我已尝试按照以下链接中的说明操作: http://stackoverflow.com/questions/25714826/error-in-manage-py-runserver-with-django-on-windows-8-1

但它没有帮助。

这就是代码行的样子:

enter image description here

(因为我是新用户,我无法将图像粘贴到原始帖子)

任何人遇到过类似的问题并有解决方案吗?

1 个答案:

答案 0 :(得分:0)

由于Windows 10中的虚拟环境存在困难,我曾经遇到过类似的问题。尝试以管理员身份运行powershell,如果remotesigned不起作用,请执行“Set-ExecutionPolicy RemoteSigned”或“Set-ExecutionPolicy Unrestricted”。在激活virtualenv之前执行此操作。

相关问题