我正在使用Anaconda python,我正在尝试使用官方文档运行一个简单的Django服务器。当我运行python manage.py runserver
时,我收到此错误
Nuseirs-MacBook-Pro:anothertry nyassin$ python manage.py runserver
Validating models...
0 errors found
November 06, 2013 - 18:27:10
Django version 1.7.dev20131105182658, using settings 'anothertry.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 416, in execute_from_command_line
utility.execute()
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 408, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 244, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 291, in execute
output = self.handle(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 76, in handle
self.run(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 85, in run
autoreload.main(self.inner_run, args, options)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 359, in main
reloader(wrapped_main_func, args, kwargs)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 325, in python_reloader
reloader_thread()
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 304, in reloader_thread
if fn():
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in kqueue_code_changed
new_descriptors = set(open(filename) for filename in new_filenames)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in <genexpr>
new_descriptors = set(open(filename) for filename in new_filenames)
IOError: [Errno 24] Too many open files: '//anaconda/lib/python2.7/lib-dynload/resource.so'
任何可能导致此问题的想法?
答案 0 :(得分:0)
这是一个操作系统错误。最大打开文件数量有限。尝试找到打开文件的位置,忘记关闭它们。
一次打开较少的文件描述符。
set(open(filename) for filename in new_filenames)
是发生错误的地方。