timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 74 forks source link

extensions error, ImportError: No module named 'tables' #138

Closed weqopy closed 4 years ago

weqopy commented 4 years ago

I have update my settings file follow the Quick Fix 1 #85 like this:

{
  "renderer_options-MarkdownRenderer": {
    "extensions": ["tables", "fenced_code", "codehilite"]
  },
}

It worked fine in the first time after I updated the settings. But now Chrome returns the error like I have never updated the settings before:

Error: 404 Not Found
Sorry, the requested URL 'http://127.0.0.1:51004/view/25' caused an error:

'buffer_id(25) is not valid (closed or unsupported file format)'

**NOTE:** If you run multiple instances of Sublime Text, you may want to adjust
the `server_port` option in order to get this plugin work again.

And then I found this in SublimeText's console:

OmniMarkupPreviewer: [ERROR] Exception occured while rendering using MarkdownRenderer
  Traceback (most recent call last):
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/RendererManager.py", line 266, in render_text
    rendered_text = renderer.render(text, filename=filename)
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/MarkdownRenderer.py", line 48, in render
    extensions=self.extensions)
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 390, in markdown
    md = Markdown(**kwargs)
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 100, in __init__
    configs=kwargs.get('extension_configs', {}))
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 126, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
    File "/Users/***/Library/Application Support/Sublime Text 3/Packages/python-markdown/st3/markdown/core.py", line 166, in build_extension
    module = importlib.import_module(ext_name)
    File "./python3.3/importlib/__init__.py", line 90, in import_module
    File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1529, in _find_and_load_unlocked
  ImportError: No module named 'tables'

Then I removed the 'tables'

{
  "renderer_options-MarkdownRenderer": {
    "extensions": ["fenced_code", "codehilite"]
  },
}

and the console shows ImportError: No module named 'fenced_code'

LikeSundayLikeRain commented 4 years ago

Same here.

Fizzadar commented 4 years ago

Managed to fix this by making the extensions include the markdown module, ie:

{
    "renderer_options-MarkdownRenderer": {
        "extensions": ["markdown.extensions.tables", "markdown.extensions.fenced_code", "markdown.extensions.codehilite"]
    }
}
weqopy commented 4 years ago

Managed to fix this by making the extensions include the markdown module, ie:

{
    "renderer_options-MarkdownRenderer": {
        "extensions": ["markdown.extensions.tables", "markdown.extensions.fenced_code", "markdown.extensions.codehilite"]
    }
}

It worked. Thanks!

kprojiang commented 4 years ago

Managed to fix this by making the extensions include the markdown module, ie:

{
    "renderer_options-MarkdownRenderer": {
        "extensions": ["markdown.extensions.tables", "markdown.extensions.fenced_code", "markdown.extensions.codehilite"]
    }
}

It works for me, too! Thanks! However, this solution makes me wonder, whether the latter version sublime text has changed some inner settings to parse the config file.