在windows环境下使用python2.7版本、Django版本为1.1.6
启动Django项目时,会报如下错误:
Traceback (most recent call last):
File "D:\PyCharm 2017.1\helpers\pydev\pydevd.py", line 1578, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "D:\PyCharm 2017.1\helpers\pydev\pydevd.py", line 1015, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:/Project/MyDashborad/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 62, in execute
super(Command, self).execute(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 101, in handle
self.run(**options)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 110, in run
autoreload.main(self.inner_run, None, options)
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 341, in main
reloader(wrapped_main_func, args, kwargs)
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 312, in python_reloader
exit_code = restart_with_reloader()
File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 298, in restart_with_reloader
exit_code = subprocess.call(args, env=new_environ)
File "C:\Python27\lib\subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 711, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 959, in _execute_child
startupinfo)
File "D:\PyCharm 2017.1\helpers\pydev\_pydev_bundle\pydev_monkey.py", line 420, in new_CreateProcess
return getattr(_subprocess, original_name)(app_name, patch_arg_str_win(cmd_line), *args)
WindowsError: [Error 87]
但是不是每次启动都会报错,在10次中可能会有1次成功
Error 87: The Parameter is incorrect
这个错误是命令行参数不正确.
你试试用cmd启动项目,不用pycharm直接启动.
也许是pycharm的问题.