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

Cannot open .ipynb without .md file #31

Open
lace-wing opened this issue Jun 28, 2023 · 0 comments
Open

Cannot open .ipynb without .md file #31

lace-wing opened this issue Jun 28, 2023 · 0 comments

Comments

@lace-wing
Copy link

lace-wing commented Jun 28, 2023

Symptom

While opening an .ipynb file, an error will occur:

Error detected while processing BufReadCmd Autocommands for "*.ipynb"..function <SNR>17_read_from_ipynb:                                              
line   24:
jupytext --to=md --output='/private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Personal/IBDP/BusinessManage
ment/IA/j_p.md' '/private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Personal/IBDP/BusinessManagement/IA/j_
p.ipynb': 1

However, if an .md file with the same name generated by Jupytext is there, the .ipynb file can be opened, changes made in the .ipynb file is synced to the .md file.

After pressing Enter to proceed, the file will seem to be empty (as conversion failed).

Jupytext itself works well. For-back conversions can be done correctly.

Reproduction

  1. Create an .ipynb file via Jupyter Lab/Notebook
  2. Open the file via Vim
  3. An error will occur as mentioned above

Specs

  • OS: Darwin 22.5.0/iPadOS 16.5
  • Arch: Arm64
  • Machine: iPad Pro 3
  • App: a-Shell, runs a Linux-like shell
  • Python: 3.11.0
  • Vim: 8.2
  • Anaconda: not installed
  • Pandoc: not installed

Debug Messages

Messages from :messages after let g:jupytext_print_debug_msgs = 1:

DBG: filename: /private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.ipynb                         
DBG: filename exists: 1
DBG: jupytext_file: /private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.md
DBG: jupytext_file exists: 0
DBG: Generate file /private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.md
DBG: cmd: jupytext --to=md --output='/private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.md' '/pr
ivate/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.ipynb'
DBG: pandoc: command not found^@[jupytext] Reading /private/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Documents/Loca
l/j_p.ipynb in format ipynb^@Traceback (most recent call last):^@  File "/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/
Library/bin/jupytext", line 8, in <module>^@    sys.exit(jupytext())^@             ^^^^^^^^^^^@  File "/var/mobile/Containers/Data/Application/6B7E2B9
2-E388-481D-8893-F1E3F0AAE8B8/Library/lib/python3.11/site-packages/jupytext/cli.py", line 488, in jupytext^@    exit_code += jupytext_single_file(nb_f
ile, args, log)^@                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^@  File "/var/mobile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1
E3F0AAE8B8/Library/lib/python3.11/site-packages/jupytext/cli.py", line 864, in jupytext_single_file^@    base_path(nb_dest, dest_fmt)^@  File "/var/mo
bile/Containers/Data/Application/6B7E2B92-E388-481D-8893-F1E3F0AAE8B8/Library/lib/python3.11/site-packages/jupytext/paired_paths.py", line 55, in base
_path^@    raise InconsistentPath(^@jupytext.paired_paths.InconsistentPath: Notebook path ''/private/var/mobile/Containers/Data/Application/6B7E2B92-E
388-481D-8893-F1E3F0AAE8B8/Documents/Local/j_p.md'' was expected to have extension '.md'^@
@lace-wing lace-wing changed the title Error while opening files with _ in filename Cannot open .ipynb without .md file Jun 28, 2023
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

1 participant