tsengwoody / Access8Math

Allows access math content written by MathML ; Assist writing math content by LaTeX
GNU General Public License v2.0
32 stars 15 forks source link

Failed to import optparse in NVDA Alpha #86

Closed tage64 closed 7 months ago

tage64 commented 11 months ago

Hello,

I run NVDA Alpha and get an import error for optparse when Access8Math is initialized:

  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\__init__.py", line 99, in <module>
    from .command.context import A8MFEVContextMenuView
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\command\context.py", line 11, in <module>
    from ..editor import EditorFrame
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\editor.py", line 9, in <module>
    from lib.viewHTML import Access8MathDocument
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\lib\viewHTML.py", line 25, in <module>
    import markdown2
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\package\markdown2.py", line 110, in <module>
    import optparse
ModuleNotFoundError: No module named 'optparse'

Since Access8Math isn't a command line application, I think it would be possible to get rid of that dependency, right?

And when this issue is fixed, how can I install this addon from source? It doesn't seem to be a dev-branch for Access8Math in the addon store.

Best regards, Tage

tsengwoody commented 11 months ago

Hello,

Since Access8Math isn't a command line application, I think it would be possible to get rid of that dependency, right?

The term "command" in error message is just a module named "command" and is not related to a command line application. The issue you are facing is due to the Python version in NVDA Alpha being 3.11 and each version of Python included in NVDA comes with a slightly different standard library, which necessitates some adjustments. I plan to address these changes after the release of NVDA 2024.1 beta, as the API will be more stable by then.

And when this issue is fixed, how can I install this addon from source? It doesn't seem to be a dev-branch for Access8Math in the addon store

Currently, Access8Math does not have a practice of submitting a dev version. However, I will consider doing this in the future.

Best regards, Woody

tage64 commented 7 months ago

When updating Access8Math to v3.8 I still get the following error in NVDA 2024.1RC1:

Error importing global plugin Access8Math
Traceback (most recent call last):
  File "globalPluginHandler.pyc", line 23, in listPlugins
...
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\lib\mathProcess.py", line 7, in <module>
    from py_asciimath.translator.translator import (
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\package\py_asciimath\translator\translator.py", line 5, in <module>
    import lxml.etree
ModuleNotFoundError: No module named 'lxml.etree'

As NVDA 2024.1 is coming soon I think this has to be fixed.

Thanks, Tage

tsengwoody commented 7 months ago

I will release v4.0 in a few days, and it will be compatible with NVDA 2024.1.

tsengwoody commented 7 months ago

Access8Math v4.0 is compatible with NVDA 2024.1