gristlabs / asttokens

Annotate Python AST trees with source text and token information
Apache License 2.0
172 stars 34 forks source link

ModuleNotFoundError: No module named 'six.moves' with python 3.12 #133

Closed saiaprameya closed 1 year ago

saiaprameya commented 1 year ago

File "python3.12/site-packages/IPython/core/ultratb.py", line 104, in import stack_data File "python3.12/site-packages/stack_data/init.py", line 1, in from .core import Source, FrameInfo, markers_from_ranges, Options, LINE_GAP, Line, Variable, RangeInLine, \ File "python3.12/site-packages/stack_data/core.py", line 16, in from asttokens.util import Token File "python3.12/site-packages/asttokens/init.py", line 22, in from .asttokens import ASTText, ASTTokens, supports_tokenless File "python3.12/site-packages/asttokens/asttokens.py", line 25, in from six.moves import xrange # pylint: disable=redefined-builtin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'six.moves'

pip list | grep six six 1.15.0 pip list | grep asttokens asttokens 2.4.1

saiaprameya commented 1 year ago

one observation is that when i run in python3.12 i see that: import six six.moves.xrange starts working but its not allowing to do from six.moves import xrange which is a strange thing.

alexmojaki commented 1 year ago

Upgrade six

saiaprameya commented 1 year ago

Thanks Alex it worked.

PeterJCLaw commented 1 year ago

I think this suggests a bug in asttokens? If the package isn't specifying the right version/range of its dependencies then that's something we should probably fix.

alexmojaki commented 1 year ago

Yes but really we should review https://github.com/gristlabs/asttokens/pull/117 and get rid of six completely