frnmst/md-toc

I get thi serror after `pip install md-toc`

Closed this issue · 4 comments

λ md_toc --help
Traceback (most recent call last):
  File "d:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Anaconda3\Scripts\md_toc.exe\__main__.py", line 5, in <module>
  File "d:\anaconda3\lib\site-packages\md_toc\__init__.py", line 23, in <module>
    from .api import (
  File "d:\anaconda3\lib\site-packages\md_toc\api.py", line 25, in <module>
    import curses.ascii
  File "d:\anaconda3\lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'

Hi,
this seems to be caused by the the python interpreter you are using and not by md-toc. I have no idea if it works (I don't use windows) but you can try this: pmbarrett314/curses-menu#18 (comment)

@frnmst - thanks for pointing out.

I now see md-toc does not specify windows-curses is setup, so it is not found on the system. It appears a missed dependency issue. Maybe there is a way to add it to setup file.

The interpreter is all the same, it is not the issue.

pip install windows-curses allows md_toc --help to run

Yes, windows-curses is not in the setup file because it is not needed on GNU/Linux. Infact it seems that curses.ascii is part of the standard python modules. See https://docs.python.org/3.9/library/curses.ascii.html#module-curses.ascii

Maybe a solution would be to put it in optional dependencies or to rewrite the code section without using curses.ascii.