imbue-ai / jupyter_ascending.vim

Vim plugin to interact with jupyter_ascending
MIT License
166 stars 16 forks source link

Cells do not execute #3

Closed jeremy-p-mann closed 3 years ago

jeremy-p-mann commented 3 years ago

I am using jupyter-notebook 6.1.5 and neovim 0.4.4

$ jupyter --version
jupyter core     : 4.7.0
jupyter-notebook : 6.1.5
qtconsole        : 5.0.2
ipython          : 7.19.0
ipykernel        : 5.3.4
jupyter client   : 6.1.7
jupyter lab      : 3.0.7
nbconvert        : 6.0.7
ipywidgets       : 7.5.1
nbformat         : 5.0.8
traitlets        : 5.0.5
$ jupyter nbextension     list
Known nbextensions:
  config dir: /Users/jeremymann/.jupyter/nbconfig
    notebook section
      jupytext/index  enabled
      - Validating: OK
  config dir: /usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/etc/jupyter/nbconfig
    notebook section
      jupyter_ascending/extension  enabled
      - Validating: OK
      pydeck/extensionRequires  enabled
      - Validating: OK
  config dir: /usr/local/etc/jupyter/nbconfig
    notebook section
      jupytext/index  enabled
      - Validating: OK
      plotlywidget/extension  enabled
      - Validating: OK
      pydeck/extension  enabled
      - Validating: problems found:
        - require?  X pydeck/extension
      jupyter-js-widgets/extension  enabled
      - Validating: OK
$ jupyter nbextension     list
Known nbextensions:
  config dir: /Users/jeremymann/.jupyter/nbconfig
    notebook section
      jupytext/index  enabled
      - Validating: OK
  config dir: /usr/local/Cellar/python@3.9/3.9.1_3/Frameworks/Python.framework/Versions/3.9/etc/jupyter/nbconfig
    notebook section
      jupyter_ascending/extension  enabled
      - Validating: OK
      pydeck/extensionRequires  enabled
      - Validating: OK
  config dir: /usr/local/etc/jupyter/nbconfig
    notebook section
      jupytext/index  enabled
      - Validating: OK
      plotlywidget/extension  enabled
      - Validating: OK
      pydeck/extension  enabled
      - Validating: problems found:
        - require?  X pydeck/extension
      jupyter-js-widgets/extension  enabled
      - Validating: OK
joshalbrecht commented 3 years ago

I'm actually not that familiar with vim plugins or anything, but my guess is that the error is actually not with vim, but with the way jupyter ascending is set up (because we haven't even really officially launched it, partly because of how annoying it is to set up correctly right now!)

All the vim plugin does is call a command line program with some particular arguments, so the best way to debug this is to make sure that the command line call succeeds. Try running this from the same working directory as your vim process and using whatever python will be active for that vim process (replacing the $absolute_file_path and $line_number variables)

python -m jupyter_ascending.requests.execute --filename $absolute_file_path --linenumber $line_number

You can (and should) enable debugging on both the client and server by setting these environment variables:

# client
JUPYTER_ASCENDING_LOG_LEVEL=DEBUG JUPYTER_ASCENDING_SHOW_TO_STDOUT=1 JUPYTER_ASCENDING_IS_LOGGING_ENABLED=1 python -m jupyter_ascending.requests.execute --filename $absolute_file_path --linenumber $line_number

# server--launch jupyter notebook like this instead of however you normally do:
JUPYTER_ASCENDING_LOG_LEVEL=DEBUG JUPYTER_ASCENDING_SHOW_TO_STDOUT=1 JUPYTER_ASCENDING_IS_LOGGING_ENABLED=1 jupyter notebook
richban commented 3 years ago

Opened a PR for this.

The jupyter_ascending and jupyter_ascending.vim docs where not aligned and the vim plugin matched on synced and not sync

if match(file_name, g:jupyter_ascending_match_pattern) < 0 return endif

joshalbrecht commented 3 years ago

Ahh, that makes sense. Thanks for fixing!

I merged the PR, so lmk if it still doesn't work for some reason.

richban commented 3 years ago

Thanks for closing.