首页 文章

在Windows 10上使用Django的runserver出错

提问于
浏览
1

我使用的是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“,第177行,在execute_from_command_line utility.execute()文件”c:\ users \ noabendor87 \ appdata \ local \程序\ 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中自执行(* 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行,执行输出= 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(** options)文件”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 \程序\ 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

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

相关问题