[Python] Trying to import latex2sympy2 and ERROR "ModuleNotFoundError: No module named...

Discussão em 'Python' iniciado por Stack, Outubro 20, 2024.

  1. Stack

    Stack Membro Participativo

    I followed step by step installation for the Latex Sympy Calculator from this page : https://github.com/OrangeX4/Latex-Sympy-Calculator/blob/main/README.md

    But when trying, on VS Code, import latex2sympy2 I get :

    Traceback (most recent call last):
    File "<python-input-1>", line 1, in <module>
    import latex2sympy2
    File "C:\Users\usuario\AppData\Local\Programs\Python\Python313\Lib\site-packages\latex2sympy2.py", line 4, in <module>
    from antlr4 import InputStream, CommonTokenStream
    File "C:\Users\usuario\AppData\Local\Programs\Python\Python313\Lib\site-packages\antlr4\__init__.py", line 6, in <module>
    from antlr4.CommonTokenStream import CommonTokenStream
    File "C:\Users\usuario\AppData\Local\Programs\Python\Python313\Lib\site-packages\antlr4\CommonTokenStream.py", line 33, in <module>
    from antlr4.Lexer import Lexer
    File "C:\Users\usuario\AppData\Local\Programs\Python\Python313\Lib\site-packages\antlr4\Lexer.py", line 12, in <module>
    from typing.io import TextIO
    ModuleNotFoundError: No module named 'typing.io'; 'typing' is not a package


    I'm with Python 3.13.0 installed.

    I tried uninstalling all versions of python and install back and nothing changed. Note that I did exactly the same on another computer (both on Windows 11) and it works perfectly on the other one but not on this one.

    EDIT : The problem is solved by installing Python 3.12. Thanks to the comment of STerliakov.

    Continue reading...

Compartilhe esta Página