facelessuser / sublime-markdown-popups

Markdown popup dependency for Sublime
https://facelessuser.github.io/sublime-markdown-popups/
Other
112 stars 13 forks source link

ImportError: cannot import name markdown #125

Closed thep0y closed 3 years ago

thep0y commented 3 years ago

An exception occurred when importing mdpopups.

Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
    m = importlib.import_module(modulename)
  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 1532, in _find_and_load_unlocked
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/boot.py", line 7, in <module>
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/__init__.py", line 12, in <module>
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/sessions.py", line 2, in <module>
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/edit.py", line 2, in <module>
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/open.py", line 8, in <module>
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1692, in load_module
    exec(compile(source, source_path, 'exec'), mod.__dict__)
  File "/home/thepoy/.config/sublime-text/Installed Packages/LSP.sublime-package/plugin/core/views.py", line 24, in <module>
  File "/home/thepoy/.config/sublime-text/Packages/mdpopups/st3/mdpopups/__init__.py", line 12, in <module>
    from . import markdown
ImportError: cannot import name markdown
facelessuser commented 3 years ago

Maybe restart Sublime? I imagine maybe it just updated?

thep0y commented 3 years ago

Maybe restart Sublime? I imagine maybe it just updated?

I have already restarted Sublime, but Sublime still throws this exception. It happens on Linux and Mac.

facelessuser commented 3 years ago

Maybe something went wrong with the update then. Try deleting mdpopups from your Packages folder. Run Package Control: Satisfy dependencies from the command palette, check the console to make sure it finishes updating, and then restart Sublime. I'm running it right now without issues, and I know the LSP guys tested it recently, so I'm pretty sure it should run without issues.

rwols commented 3 years ago

The version string is imported here: https://github.com/sublimelsp/LSP/blob/f08b63b5864faf04c489c3b49a49eb52a98d3e61/plugin/core/sessions.py#L157

thep0y commented 3 years ago

Maybe something went wrong with the update then. Try deleting mdpopups from your Packages folder. Run Package Control: Satisfy dependencies from the command palette, check the console to make sure it finishes updating, and then restart Sublime. I'm running it right now without issues, and I know the LSP guys tested it recently, so I'm pretty sure it should run without issues.

I have tried these operations you said and can't solve this issue. It seems that this issue that has occurred after the LSP is updated, and mdpopups can be imported normally before that. I can not determine the cause of this issue.

facelessuser commented 3 years ago

I cannot reproduce this issue at all. You may need to try a Sublime revert: https://www.sublimetext.com/docs/revert.html

What version of Sublime Text are you running?


This is what I did to try and recreate the issue. Basically, I had a fresh Sublime Text install (Build 4113) to try and recreate. Here are my steps:

  1. I have created a fresh portable install of ST on my mac (add Data folder to Sublime Text.app/Contents/MacOS and run xattr -cr Sublime\ Text.app). So the environment is fresh with no plugins or anything installed.

  2. I installed Package Control and then LSP.

  3. Restarted Sublime.

  4. Checked console, no errors.

  5. Imported mdpopups within the Sublime console (under PY3.3 console). No issues.

    Python 3.3>>> import mdpopups
    Python 3.3>>> mdpopups.version()
    (4, 2, 0)
    Python 3.3>>> mdpopups.markdown.__version__
    '3.2.2'
  6. Installed another plugin (BracketHighlighter) that uses mdpopups, just to quickly confirm popups are working:

    Screen Shot 2021-09-07 at 5 31 15 AM

@gir-bot add S: more-info-needed

thep0y commented 3 years ago

This issue was resolved after reverting sublime.