mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.6k stars 386 forks source link

jupytext not syncing notebook to python files #1274

Open nathaniellarson opened 21 hours ago

nathaniellarson commented 21 hours ago

Context I am working on a Amazon Linux 2 machine that has JupyterLab installed. But instead of using the command palette I paired my notebooks using a jupytext.toml file.

File structure of this directory:

.
├── jupytext.toml
├── file1.py
├── file2.py
├── file3.py
└── other_directory

Contents of jupytext.toml:

notebook_metadata_filter="-all"
cell_metadata_filter="-all"
formats="ipynb,py:percent"

Current version:

$ pip freeze | grep jupytext
jupytext==1.16.4

Situation

After cloning a fresh copy of my repo onto the machine, jupytext doesn't work immediately. Instead, I run:

jupytext --sync file1.py file2.py file3.py

The output of that command was:

[jupytext] Reading /home/jupyter/file1.py in format py
[jupytext] Updating /home/jupyter/file1.ipynb
[jupytext] Updating /home/jupyter/file1.py
[jupytext] Reading /home/jupyter/file2.py in format py
[jupytext] Updating /home/jupyter/file2.ipynb
[jupytext] Updating /home/jupyter/file2.py
[jupytext] Reading /home/jupyter/file3.py in format py
[jupytext] Updating /home/jupyter/file3.ipynb
[jupytext] Updating /home/jupyter/file3.py

Problem My problem is that when I continue to make edits in, say, /home/jupyter/file3.ipynb and save, those changes are not saving. I added just the text test into some markdown and it didn't sync, even waiting many minutes. Am I doing something wrong here?

mwouts commented 3 hours ago

Hey @nathaniellarson , how did you install Jupytext on that machine?

Can you check that Jupytext is available in the environment that you use to launch Jupyter Lab / how do the Jupyter logs look like?

You can tell whether Jupytext is active in Jupyter Lab by looking at the icons for .py and .md files - they have a notebook icon when Jupytext is active.