Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Stopped working on SublimeText 2 Windows #307

Closed
DannyBen opened this issue Dec 7, 2015 · 21 comments
Closed

Stopped working on SublimeText 2 Windows #307

DannyBen opened this issue Dec 7, 2015 · 21 comments

Comments

@DannyBen
Copy link

DannyBen commented Dec 7, 2015

I no longer have the "Preview Markdown" option in the menu.

Uninstall and reinstall did not help.

It worked several days ago.

@facelessuser
Copy link
Collaborator

Are you seeing errors in the console?

@facelessuser
Copy link
Collaborator

Please also provide as much detail as you can, system etc.

@facelessuser
Copy link
Collaborator

Also, did you restart after the update? A big update like the one pushed out will likely not reload well via Package Control and will require a Sublime restart.

@facelessuser
Copy link
Collaborator

I did test this before the release, and I just verified again that it is working for me in both OSX and Windows ST2, so you will need to provide more details. For further investigation.

@DannyBen
Copy link
Author

DannyBen commented Dec 7, 2015

Ok. More details.

0. System

  • Windows 10
  • Sublime Text 2

1. Package Control Remove - console output

Package Control: The package Markdown Preview has been removed and will be cleaned up on the next restart
reloading /C/Users/Danny/AppData/Roaming/Sublime Text 2/Packages/User/Package Control.sublime-settings
Package Control: The orphaned dependency pygments has been removed
Unloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\01-pygments.py
Package Control: The orphaned dependency pyyaml has been removed
Unloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\0_package_control_loader\50-pyyaml.py

2. Restarted sublime

3. Package Control Install - console output

Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\helper.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\abbr.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\admonition.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\attr_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\codehilite.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\def_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\delete.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\extra.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\fenced_code.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\footnotes.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\github.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\githubemoji.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
  File ".\helper.py", line 67, in <module>
    __import__(package)
  File ".\markdown\extensions\headeranchor.py", line 35, in <module>
    from .toc import slugify, stashedHTML2text, unique, TocExtension
  File ".\markdown\extensions\toc.py", line 23, in <module>
    import unicodedata
ImportError: No module named unicodedata
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown_settings.py
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown_wrapper.py
Reloading plugin C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\MarkdownPreview.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\abbr.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\admonition.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\attr_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\codehilite.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\def_list.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\delete.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\extra.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\fenced_code.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\footnotes.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\github.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\githubemoji.py
Reloading plugin extension C:\Users\Danny\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
  File ".\MarkdownPreview.py", line 49, in <module>
    from helper import INSTALLED_DIRECTORY
  File ".\helper.py", line 67, in <module>
    __import__(package)
  File ".\markdown\extensions\headeranchor.py", line 35, in <module>
    from .toc import slugify, stashedHTML2text, unique, TocExtension
  File ".\markdown\extensions\toc.py", line 23, in <module>
    import unicodedata
ImportError: No module named unicodedata
found 8 files for base name Main.sublime-menu
theme loaded
reloading /C/Users/Danny/AppData/Roaming/Sublime Text 2/Packages/User/Preferences.sublime-settings
found 1 files for base name Soda Light Modded.sublime-theme
theme loaded

Let me know what else you need.

@facelessuser
Copy link
Collaborator

I think that is all I need. It can't find unicodedata. I need to revisit why some systems can't find this on ST2. I think some of Markdown Previews internal dependencies had some hacks for this, but when we removed the internal dependencies for package control managed dependencies, we lost the advantage of those ST2 specific hacks. I need to put those back in.

I will add the fix later, but I will need you to test them locally for verification as I am not experiencing this problem.

@DannyBen
Copy link
Author

DannyBen commented Dec 7, 2015

Sure thing.

@cjhgo
Copy link

cjhgo commented Dec 7, 2015

i suffer the same problem.hope the fix.

@facelessuser
Copy link
Collaborator

Found the hack: b631e1d.

Will probably need to put this at the top level in MarkdownPreview.py. I will get to this after work today.

@Albinutte
Copy link

Looks like my problem, thanks for looking into it

@facelessuser facelessuser mentioned this issue Dec 8, 2015
@facelessuser
Copy link
Collaborator

If someone with unicodedata trouble can try out #308 pull request and let me know if it solves your problems, I will be able to push out a new bug fix release.

@hkant
Copy link

hkant commented Dec 8, 2015

my sublime2 in windows 8 also can not show markdown preview .and the console show "Reloading plugin extension C:\Users\myPC\AppData\Roaming\Sublime Text 2\Packages\Markdown Preview\markdown\extensions\headeranchor.py
Traceback (most recent call last):
File ".\sublime_plugin.py", line 62, in reload_plugin
File ".\helper.py", line 67, in
import(package)
File ".\markdown\extensions\headeranchor.py", line 35, in
from .toc import slugify, stashedHTML2text, unique, TocExtension
File ".\markdown\extensions\toc.py", line 23, in
import unicodedata
ImportError: No module named unicodedata"

@facelessuser
Copy link
Collaborator

"me too" isn't going to get this fixed, I need someone to confirm that #308 fixes the issue.

@hkant
Copy link

hkant commented Dec 8, 2015

i fix my problem by the method of commit " b631e1d":
from ..util import HTML_PLACEHOLDER_RE, parseBoolValue
import re
import logging
-import unicodedata
+try:

  • import unicodedata
    +except:
  • import sys
  • from os.path import dirname
  • sys.path.append(dirname(sys.executable))
  • import unicodedata

logger = logging.getLogger('MARKDOWN')

@facelessuser you modify the file of headerid.py,but there is also a same problem in the file of markdown\extensions\toc.py

@facelessuser
Copy link
Collaborator

@hkant Please see #308. The link to the commit was only showing what needed to be done to import unicodedata. Yes I admit that location alone was not enough, but since #308 moves it to be one of the first imports, it should be in the path by time toc or headerid or whatever calls it.

@facelessuser
Copy link
Collaborator

It is possible we need to place it here as well https://github.com/revolunet/sublimetext-markdown-preview/blob/master/markdown_wrapper.py.

@facelessuser
Copy link
Collaborator

It actually appears that we should drop this in helper.py as Sublime seems to load them alphabetically.

@facelessuser
Copy link
Collaborator

#308 has been updated with unicodedata loading in helper.py

@DannyBen
Copy link
Author

DannyBen commented Dec 8, 2015

Looks like #308 is working. I just copied the modified files and placed them where they need to be.

The console now looks clean of errors and the "Markdown Preview" menu items are back.

@facelessuser
Copy link
Collaborator

Thanks, I will go ahead and push it out.

@DannyBen
Copy link
Author

DannyBen commented Dec 8, 2015

Thanks for the quick fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants