aaren / notedown

Markdown <=> IPython Notebook
BSD 2-Clause "Simplified" License
855 stars 115 forks source link

notedown doesn't work with Jupter Notebook 5.1.0 #60

Closed adonese closed 7 years ago

adonese commented 7 years ago

Whenever I run notedown it returns with this error

$ notedown 
Traceback (most recent call last):
  File "/home/adonese/anaconda3/bin/notedown", line 7, in <module>
    from notedown.main import app
  File "/home/adonese/anaconda3/lib/python3.5/site-packages/notedown/__init__.py", line 8, in <module>
    from .contentsmanager import NotedownContentsManager
  File "/home/adonese/anaconda3/lib/python3.5/site-packages/notedown/contentsmanager.py", line 8, in <module>
    from notebook.services.contents.filemanager import FileContentsManager
  File "/home/adonese/anaconda3/lib/python3.5/site-packages/notebook/services/contents/filemanager.py", line 21, in <module>
    from .manager import ContentsManager
  File "/home/adonese/anaconda3/lib/python3.5/site-packages/notebook/services/contents/manager.py", line 37, in <module>
    class ContentsManager(LoggingConfigurable):
  File "/home/adonese/anaconda3/lib/python3.5/site-packages/notebook/services/contents/manager.py", line 69, in ContentsManager
    untitled_notebook = Unicode(_("Untitled"), config=True,
NameError: name '_' is not defined

The same applied when I try to import it from python shell.

undavide commented 7 years ago

Same error here, even if with a slightly different stack trace:

(PYTHON3)  🦊  notedown
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/notedown", line 7, in <module>
    from notedown.main import app
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notedown/__init__.py", line 8, in <module>
    from .contentsmanager import NotedownContentsManager
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notedown/contentsmanager.py", line 8, in <module>
    from notebook.services.contents.filemanager import FileContentsManager
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 21, in <module>
    from .manager import ContentsManager
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 37, in <module>
    class ContentsManager(LoggingConfigurable):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/notebook/services/contents/manager.py", line 69, in ContentsManager
    untitled_notebook = Unicode(_("Untitled"), config=True,
NameError: name '_' is not defined

Thanks!

pca2 commented 7 years ago

Ditto on 2.7:

Traceback (most recent call last):
  File "/usr/local/bin/notedown", line 7, in <module>
    from notedown.main import app
  File "/usr/local/lib/python2.7/site-packages/notedown/__init__.py", line 8, in <module>
    from .contentsmanager import NotedownContentsManager
  File "/usr/local/lib/python2.7/site-packages/notedown/contentsmanager.py", line 8, in <module>
    from notebook.services.contents.filemanager import FileContentsManager
  File "/usr/local/lib/python2.7/site-packages/notebook/services/contents/filemanager.py", line 21, in <module>
    from .manager import ContentsManager
  File "/usr/local/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 37, in <module>
    class ContentsManager(LoggingConfigurable):
  File "/usr/local/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 69, in ContentsManager
    untitled_notebook = Unicode(_("Untitled"), config=True,
NameError: name '_' is not defined
grst commented 7 years ago

adding

import notebook.transutils

on top of each file which imports from manager should fix the issue.

See https://github.com/jupyter/notebook/issues/2798

holgerbrandl commented 7 years ago

Same error here when using notebook v5.2.0

aaren commented 7 years ago

latest master should fix this, but note that this is still using the v4 notebook format.