Skip to content

Unable to compile less file. #162

@swastkk

Description

@swastkk

Used the python manage.py compilestatic command to compile the card.less file which is in the static folder of django project, getting this error

(venv) [swastik@manjaro eduBOT]$ python manage.py compilestatic
Traceback (most recent call last):
  File "/home/swastik/Desktop/Projects/eduBOT/manage.py", line 22, in <module>
    main()
  File "/home/swastik/Desktop/Projects/eduBOT/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/static_precompiler/management/commands/compilestatic.py", line 116, in handle
    compiled_files.add(compiler.compile(path, from_management=True, verbosity=verbosity))
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/static_precompiler/compilers/base.py", line 161, in compile
    compiled_path = self.compile_file(source_path)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/static_precompiler/compilers/less.py", line 66, in compile_file
    return_code, out, errors = utils.run_command(args, cwd=cwd)
  File "/home/swastik/Desktop/Projects/eduBOT/venv/lib/python3.10/site-packages/static_precompiler/utils.py", line 66, in run_command
    p = subprocess.Popen(args, **popen_kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'lessc'

Also my html was not rendering as well
Used in this manner <link rel="stylesheet" href="{% static 'card.less'|compile %}" />
Getting this in browser
image
Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions