Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupytext still not working (content handlers still seem to be bypassed). #157

Open
cycomanic opened this issue Oct 5, 2022 · 5 comments

Comments

@cycomanic
Copy link

#147 was fixed with #148 but nbclassic still downloads .py files instead of opening via jupytext as referred to in #147. Is there something that jupytext should be doing differently?

@echarles
Copy link
Member

.py opens fine for me on nbclassic. Can you bring more details on how you are using jupytext and how you come to a download? Thx.

Screenshot 2022-10-10 at 09 44 15

@cycomanic
Copy link
Author

I just tested again:

$vf new jupytest # create virtual environment
$pip install jupyterlab nbclassic
$pip install jupytext
$touch test.py
$jupyter nbclassic

If I open the test.py file in the notebook window I get the browser save file dialog. (This is firefox on linux). I also tried a different py file which was previously linked to a notebook and I get the same.

Output of jupyter labextensions list:

JupyterLab v3.4.8
/home/jschrod/.virtualenvs/jupytexttest/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyterlab-jupytext v1.3.8+dev enabled OK (python, jupytext)

/usr/share/jupyter/labextensions
        jupyter-matplotlib v0.10.5 enabled OK

(it seems some of my system extensions still get picked up, but that should not really be a problem should it?)

Output of jupyter nbextensions list:

Known nbextensions:
  config dir: /home/jschrod/.virtualenvs/jupytexttest/etc/jupyter/nbconfig
    notebook section
      jupytext/index  enabled 
      - Validating: OK
  config dir: /etc/jupyter/nbconfig
    notebook section
      jupyter-matplotlib/extension  enabled 
      - Validating: OK
      rise/main  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK

Which is relevant for nbclassic btw, labextensions or nbextensions?

@echarles
Copy link
Member

There may be side-effects due to jupyterlab or jupytext, not sure. I have double checked and Firefox on MacOs opens correctly the py files. jupyter labextensions is for jupyterlab, for latests nbclassic, you have to use jupyter nbclassic-extension list. To be sure, can you post which version you have jupyter nbclassic --version

jupyter nbclassic-extension list
Known nbextensions:
  config dir: /Users/echarles/opt/miniconda3/envs/notebook/etc/jupyter/nbconfig
    notebook section
      nbextensions_configurator/config_menu/main  enabled 
      - Validating: OK
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
    tree section
      nbextensions_configurator/tree_tab/main  enabled 
      - Validating: OK

@cycomanic
Copy link
Author

cycomanic commented Oct 10, 2022

OK I just uninstalled all system files for jupyter and redid it and I still get the same result.

Output of jupyter nbclassic-extension list

Known nbextensions:
  config dir: /home/jschrod/.virtualenvs/jupytext2/etc/jupyter/nbconfig
    notebook section
      jupytext/index  enabled 
      - Validating: OK

jupyter nbclassic --version is 0.4.5

In chromium .py files open as text files.

This is running arch linux with python 3.10

@Harlool
Copy link

Harlool commented Feb 1, 2023

Hi, I'm also facing the same issue.

nbclassic got updated to 0.4.8 in my Jupyter environment and since then, jupytext doesn't work properly as python files .py open now in a text format instead of opening in a notebook format despite having the notebook icon next to the files.

Current situation

Packages version :
jupytext 1.14.4 pyhcff175f_0
nbclassic 0.4.8 pyhd8ed1ab_0

Notebook icon next to .py file :
image

.py file open in text format (not even in the "Edit" view of nbclassic, just as a basic text file in the web browser default view) :
image

Previous situation

With the previous version of nbclassic 0.2.7 installed in my environment , jupytext was working fine.

Packages version :
jupytext 1.14.4 pyhcff175f_0
nbclassic 0.2.7 pyhd8ed1ab_0

Notebook icon next to .py file :
image

.py file open in notebook format :
image

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

No branches or pull requests

3 participants