Unable to pair to a py script in the same directory
See original GitHub issueI have this project.toml
file and everything works just fine:
[tool.jupytext.formats]
"notebooks/" = "ipynb"
"src/" = "py"
"md/" = "md"
Now, I want to pair a notebook to a py
script in the same directory as the notebook, so following the docs, I modified the toml
file to:
[tool.jupytext.formats]
"notebooks/" = "ipynb,py"
"src/" = "py"
"md/" = "md"
and suddenly nothing works. I get the following error:
Unexpected error while saving file: notebooks/Untitled.ipynb
Notebook base name 'src/Untitled' is not compatible with fmt=notebooks///ipynb. Make sure you use prefix roots in either none, or all of the paired formats
Although it does silently create Untitled.py
and Untitled.md
at respective directories after throwing this error, it does NOT create a py
script in the notebooks
directory.
So how can a sync a notebook to a py
script in the same directory as the notebook without throwing errors?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
unable to import module in same directory when using pytest
It appears that import statements are relative to the directory you are currently in. The solution to calling another script in the same...
Read more >Understanding Python imports, __init__.py and pythonpath
The current directory being the one where the script being run resides. This is the reason importing is fairly straightforward when both the ......
Read more >Python on Windows FAQ — Python 3.11.1 documentation
How do I make an executable from a Python script? Is a *.pyd file the same as a DLL? How can I embed...
Read more >How to import local modules with Python - Quentin Fortier
c import d would go 2 directories up, for example. 2nd solution: run as a module. It is unfortunate that scripts can't use...
Read more >Debugging configurations for Python apps in Visual Studio Code
Run VS Code, open the folder or workspace containing the script, and create a launch.json for that workspace if one doesn't exist already....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see (that seems to be a reasonable limitation of the TOML format).
Could you try the compressed form, then?
You’re welcome!