我正在尝试运行用于build static的命令
./manage.py assets build --settings=marketplace.settings.dev我得到了回溯:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/web/market/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/web/market/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/web/market/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/web/market/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/web/market/local/lib/python2.7/site-packages/django_assets/management/commands/assets.py", line 88, in handle
impl.run_with_argv(args)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/script.py", line 547, in run_with_argv
return self.run_with_ns(ns)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/script.py", line 537, in run_with_ns
return cmd.invoke(ns.command, args)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/script.py", line 371, in invoke
return function(**args)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/script.py", line 171, in __call__
disable_cache=no_cache)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/bundle.py", line 563, in build
disable_cache=disable_cache))
File "/home/web/market/local/lib/python2.7/site-packages/webassets/bundle.py", line 498, in _build
force, disable_cache=disable_cache, extra_filters=extra_filters)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/bundle.py", line 384, in _merge_and_apply
filters_to_pass_down, disable_cache=disable_cache)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/bundle.py", line 453, in _merge_and_apply
return filtertool.apply(final, selected_filters, 'output')
File "/home/web/market/local/lib/python2.7/site-packages/webassets/merge.py", line 269, in apply
return self._wrap_cache(key, func)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/merge.py", line 216, in _wrap_cache
content = func().getvalue()
File "/home/web/market/local/lib/python2.7/site-packages/webassets/merge.py", line 249, in func
getattr(filter, type)(data, out, **kwargs_final)
File "/home/web/market/local/lib/python2.7/site-packages/webassets/filter/coffeescript.py", line 45, in output
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory我能得到一些关于如何解决这个问题的相关建议吗?
发布于 2015-10-08 17:08:11
这个错误出现在你的第三方应用django-assets上,它使用了另一个第三方python应用webassets,它的目的是压缩和最小化web资源,如Javascript、CSS等。
问题出在webassets上,它隐藏了错误配置的异常,实际原因是找不到执行压缩所需的二进制文件。这里有错误的原因:https://github.com/miracle2k/webassets/issues/400
确保正确安装了所需的操作系统依赖项(二进制文件),以允许django-assets+webassets执行所需的操作。当我第一次为同样的目的尝试其他应用程序时,我也遇到了类似的问题,比如django-pipeline,如果yuglify或其他压缩后端没有正确安装,就会出现问题。
发布于 2014-02-28 14:42:42
如你所见,他找不到你的市场设置。OSError: [Errno 2] No such file or directory
您的marketplace.settings.dev是否位于以下位置:
/home/web/market/local/lib/python2.7/site-packages/或/usr/lib/python2.7/请尝试移动marketplace目录,然后重试。
发布于 2015-10-06 20:59:00
查看manage.py文件,并确保该行指向正确的设置文件
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "marketplace.settings.dev")https://stackoverflow.com/questions/22088008
复制相似问题