paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
18.79k stars 1.74k forks source link

Uncaught AttributeError in compat.py line 124 #1617

Open ispyridis opened 2 hours ago

ispyridis commented 2 hours ago

Aider version: 0.56.0 Python version: 3.11.5 Platform: Windows-10-10.0.19045-SP0 Python implementation: CPython Virtual environment: No OS: Windows 10 (64bit) Git version: git version 2.45.2.windows.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "__main__.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 698, in main
    coder.run()
  File "base_coder.py", line 735, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 778, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1165, in send_message
    self.live_incremental_response(True)
  File "base_coder.py", line 1526, in live_incremental_response
    self.mdstream.update(show_resp, final=final)
  File "mdstream.py", line 78, in update
    console.print(markdown)
  File "console.py", line 1710, in print
    extend(render(renderable, render_options))
  File "console.py", line 1331, in render
    for render_output in iter_render:
  File "markdown.py", line 682, in __rich_console__
    yield from console.render(element, context.options)
  File "console.py", line 1335, in render
    yield from self.render(render_output, _options)
  File "console.py", line 1331, in render
    for render_output in iter_render:
  File "syntax.py", line 620, in __rich_console__
    segments = Segments(self._get_syntax(console, options))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "segment.py", line 667, in __init__
    self.segments = list(segments)
                    ^^^^^^^^^^^^^^
  File "syntax.py", line 646, in _get_syntax
    text = self.highlight(processed_code, self.line_range)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "syntax.py", line 479, in highlight
    lexer = self.lexer or self.default_lexer
            ^^^^^^^^^^
  File "syntax.py", line 432, in lexer
    return get_lexer_by_name(
           ^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 129, in get_lexer_by_name
    for cls in find_plugin_lexers():
  File "plugin.py", line 57, in find_plugin_lexers
    yield entrypoint.load()
          ^^^^^^^^^^^^^^^^^
  File "__init__.py", line 183, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "pygmentplugin.py", line 16, in <module>
    from choco import compat
  File "compat.py", line 124, in <module>
    time_func = time.clock
                ^^^^^^^^^^
AttributeError: module 'time' has no attribute 'clock'
fry69 commented 1 hour ago

Thank you for filing this issue.

This error is likely due to installing aider via system packages or other broken install methods, which do not respect the required dependencies aider needs.

Please install aider separately from other Python modules, e.g. via pipx or venv.

This document may be helpful -> https://aider.chat/docs/troubleshooting/imports.html