aider icon indicating copy to clipboard operation
aider copied to clipboard

Uncaught ModuleNotFoundError in asttokens.py line 23

Open pl018 opened this issue 1 year ago • 1 comments

Aider version: 0.57.1 Python version: 3.12.5 Platform: Windows-11-10.0.22631-SP0 Python implementation: CPython Virtual environment: No OS: Windows 11 (64bit) Git version: git version 2.46.0.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 709, in main
    coder.run()
  File "base_coder.py", line 723, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 766, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1156, in send_message
    self.live_incremental_response(True)
  File "base_coder.py", line 1515, 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 184, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "__init__.py", line 54, in <module>
    from .core.application import Application
  File "application.py", line 26, in <module>
    from IPython.core import release, crashhandler
  File "crashhandler.py", line 27, in <module>
    from IPython.core import ultratb
  File "ultratb.py", line 104, in <module>
    import stack_data
  File "__init__.py", line 1, in <module>
    from .core import Source, FrameInfo, markers_from_ranges, Options, LINE_GAP, Line, Variable, RangeInLine, \
  File "core.py", line 16, in <module>
    from asttokens.util import Token
  File "__init__.py", line 22, in <module>
    from .asttokens import ASTText, ASTTokens, supports_tokenless
  File "asttokens.py", line 23, in <module>
    import six
ModuleNotFoundError: No module named 'six'

pl018 avatar Sep 26 '24 00:09 pl018

Thank you for filing this issue.

Can you please try to install or reinstall aider in a separate Python environment? Either with venv or pipx?

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

fry69 avatar Sep 26 '24 04:09 fry69

I'm closing this issue for now.

If any new related concerns arise, please feel free to comment, and I'll reopen the issue.

fry69 avatar Oct 05 '24 12:10 fry69