axiros / terminal_markdown_viewer

Styled Terminal Markdown Viewer
Other
1.8k stars 105 forks source link

not compatible with Markdown-3.4.1 #105

Open jonashrem opened 1 year ago

jonashrem commented 1 year ago

With markdown-3.4.1 there is now longer etree

Traceback (most recent call last):
  File "mdv/bin/mdv", line 11, in <module>
    load_entry_point('mdv==1.7.4', 'console_scripts', 'mdv')()
  File "/opt/mdv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/mdv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/opt/mdv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/opt/mdv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/opt/mdv/lib/python3.8/site-packages/mdv/__init__.py", line 3, in <module>
    from .markdownviewer import run, main
  File "/opt/mdv/lib/python3.8/site-packages/mdv/markdownviewer.py", line 160, in <module>
    from markdown.util import etree
ImportError: cannot import name 'etree' from 'markdown.util' (/opt/mdv/lib/python3.8/site-packages/markdown/util.py)

markdown 2.6 works fine

dhondta commented 1 year ago

@jonashrem This was fixed with this commit but the new version of the package was not pushed to PyPi yet, hence pip install --upgrade mdv will give you the unfixed version 1.7.4 while pip install --upgrade git+http://github.com/axiros/terminal_markdown_viewer will make it. I opened a PR for solving this but it shall still be pushed to PyPi by the author.

iHnR commented 1 year ago

@dhondta I'm still getting the same error after running the fixed command. The message seems to show that it's still installing 1.7.4

Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/axiros/terminal_markdown_viewer
  Cloning https://github.com/axiros/terminal_markdown_viewer to /tmp/pip-req-build-zuvf2igl
  Running command git clone --filter=blob:none --quiet https://github.com/axiros/terminal_markdown_viewer /tmp/pip-req-build-zuvf2igl
  Resolved https://github.com/axiros/terminal_markdown_viewer to commit 435b6885d0237fe10a9f894375b10c1103bfaae0
  Preparing metadata (setup.py) ... done
Requirement already satisfied: markdown in /home/japie/.local/lib/python3.10/site-packages (from mdv==1.7.4) (3.4.1)
Requirement already satisfied: pygments in /usr/lib/python3/dist-packages (from mdv==1.7.4) (2.11.2)
igorlima commented 1 year ago

Using the argument to force reinstall helped me, at least. For further details about forcing the pip to reinstall the current version, see this StackOverflow page.

pip install --upgrade --force-reinstall git+http://github.com/axiros/terminal_markdown_viewer