hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
310 stars 60 forks source link

ContextualVersionConflict parsing to html #138

Closed Daniel-M closed 6 years ago

Daniel-M commented 6 years ago

Hello everyone,

I'm using DocOnce version 1.4.4 (compiled from source) and was trying to parse a short and simple text to html and got the following error

$ doconce format html index.do.txt 
translating doconce text in index.do.txt to html
Traceback (most recent call last):
  File "/usr/local/bin/doconce", line 1721, in <module>
    bg_session = main()
  File "/usr/local/bin/doconce", line 1710, in main
    retval = eval(command + '()')
  File "<string>", line 1, in <module>
  File "/usr/local/bin/doconce", line 103, in format
    bg_session = doconce.doconce.format_driver()
  File "/usr/local/lib/python3.6/dist-packages/doconce/doconce.py", line 5470, in format_driver
    out_filename, bg_session = file2file(filename_preprocessed, format, basename)
  File "/usr/local/lib/python3.6/dist-packages/doconce/doconce.py", line 4285, in file2file
    filestr, bg_session = doconce2format(filestr, format)
  File "/usr/local/lib/python3.6/dist-packages/doconce/doconce.py", line 4777, in doconce2format
    tex_blocks, format)
  File "/usr/local/lib/python3.6/dist-packages/doconce/html.py", line 1052, in html_code
    legal_lexers = get_legal_pygments_lexers()
  File "/usr/local/lib/python3.6/dist-packages/doconce/common.py", line 1186, in get_legal_pygments_lexers
    for classname, names, dummy, dymmy in list(get_all_lexers()):
  File "/usr/local/lib/python3.6/dist-packages/pygments/lexers/__init__.py", line 53, in get_all_lexers
    for lexer in find_plugin_lexers():
  File "/usr/local/lib/python3.6/dist-packages/pygments/plugin.py", line 53, in find_plugin_lexers
    yield entrypoint.load()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2401, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2424, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 875, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (parso 0.1.1 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('parso==0.1.0'), {'jedi'})

The text I've tried to convert was,

TITLE: Test 
AUTHOR: "Daniel-M" : "https://github.com/Daniel-M"  
DATE: November, 2017
TOC: on

========= Test =========

How can I solve the issue? it looks like a version problem with "parso"

KGHustad commented 6 years ago

Try downgrading to version 0.1.0 of parso.

pip install -U parso==0.1.0

(Prepend sudo if needed)

Daniel-M commented 6 years ago

This solves the issue, though I was wondering if there was significant changes between parso version 0.1.1 and version 0.1.0 so that the downgrade is the only way to solve the compatibility issue.

KGHustad commented 6 years ago
pkg_resources.ContextualVersionConflict: (parso 0.1.1 (/usr/local/lib/python3.6/dist-packages), Requirement.parse('parso==0.1.0'), {'jedi'})

This is really not DocOnce-related. Pygments seems to trigger some kind of dependency check for all installed packages when it lists all installed lexers. I'm guessing you have a version of jedi installed which requires parso 0.1.0. The requirement has since been changed to 0.1.1. Please ask at https://github.com/davidhalter/jedi if you need further assistance.