我正在使用 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\programs\python\python35-32\lib\site-packages\django\core\management__init__ .py",第 346 行,在执行 self.fetch_command(subcommand).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 行,在执行超级(命令,自我)。执行(* 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”,第 336 行,在主重新加载器(wrapped_main_func,args,kwargs)文件“c:\users\noabendor87\appdata\local\programs\python\python35-32\lib\site-packages\django\utils\autoreload.py”,第 307 行,在 python_reloader exit_code = restart_with_reloader() 文件“c:\users\ noabendor87\appdata\local\programs\python\python35-32\lib\site-packages\django\utils\autoreload.py",第 293 行,在 restart_with_reloader exit_code = os.spawnve(os.P_WAIT, sys.executable, args , new_environ) UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character在 restart_with_reloader exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character在 restart_with_reloader exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ) UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character
我已经尝试按照以下链接中的说明进行操作: http ://stackoverflow.com/questions/25714826/error-in-manage-py-runserver-with-django-on-windows-8-1
但它没有帮助。
这就是代码行的样子:
(由于我是新用户,我无法将图像粘贴到原始帖子)
有人遇到过类似的事情并有解决办法吗?