gpt4 book ai didi

django - OSError at/[Errno 2]没有这样的文件或目录django Assets

转载 作者:行者123 更新时间:2023-12-03 05:47:14 25 4
gpt4 key购买 nike

我正在尝试运行构建静态的命令

./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

我可以获得一些有关如何解决此问题的相关建议吗?

最佳答案

错误出现在您的第 3 方应用上 django-assets ,它使用另一个 3rd-party python 应用程序 webassets ,旨在压缩和最小化 Javascript、CSS 等 Web 资源。

问题出在webassets上,它隐藏了配置错误的异常,实际原因是找不到执行压缩所需的二进制文件这里有错误原因:https://github.com/miracle2k/webassets/issues/400

确保您已正确安装所需的操作系统依赖项(二进制文件),以允许 django-assets+webassets 执行您需要的操作。当我第一次尝试其他具有相同目的的应用程序(例如 django-pipeline)时,我遇到了类似的问题,如果 yuglify 或其他压缩后端未正确安装,则会出现问题。

关于django - OSError at/[Errno 2]没有这样的文件或目录django Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22088008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com