Closed ShadowMitia closed 6 years ago
To recreate this issue please include the versions of Jupyter Notebook, Jupyter Lab, and Ansible Kernel that you have installed. Please also include the steps that you used to install Ansible Kernel.
@benthomasson I edited my message. Sorry about that.
It looks like the way that adding custom exporters changed in Jupyter Lab from Jupyter Notebook. I'll look into supporting Jupyter Lab.
Your first screen shot for jupyter notebook
is missing a few exporters. Try running this command python -m ansible_kernel.install --sys-prefix
to enable them.
From the command line you should see:
$ jupyter nbconvert -h | grep ansible
Options include ['ansible_playbook', 'ansible_tasks', 'ansible_zip', 'asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']
Unfortunately the list of exporters appears to be hardcoded in this version of Jupyter Lab. I manually add the exporters on this branch: https://github.com/benthomasson/jupyterlab/tree/ansible_exporters
If you want to try this out run this:
git clone https://github.com/benthomasson/jupyterlab.git
cd jupyterlab
git checkout ansible_exporters
pip install -e .
jlpm install
jlpm run build
jlpm run build:core
jupyter lab build
jupyter lab --dev-mode
I tried testing your branch, but I think I have something wrong with my jupyter installation, when running jupyter lab --dev-mode
it fails to launch with a FileNotFoundError: [Errno 2] No such file or directory: '/home/dimitri/.local/lib/python3.6/site-packages/packages/theme-light-extension': '/home/dimitri/.local/lib/python3.6/site-packages/packages/theme-light-extension'
.
I'll just have to remember to test this kernel in the notebook in the meantime.
Thank you for the quick response! Hope they'll fix this harcoded exports list business soon.
I ran into the same issue. Try running pip install -e .
again in the jupyterlab
directory.
You mean the one inside the cloned folder? I get this message: Directory '.' is not installable. File 'setup.py' not found.
Try the parent directory. There should be a setup.py
there.
I managed to make it work by using pip3 install --user -e .
(I was using sudo
before).
Finally I can see the exports!
Thanks!
I added a feature request for this in JupyterLab here: jupyterlab/jupyterlab#5015
Describe the bug When running a jupyter notebook (with
jupyter notebook
command), there available ansible exports in File -> Download As.When running jupyterlab (with
jupyter lab
command), the menu is called Exports, and doesn't contain ansible exports choices.To Reproduce Steps to reproduce the behavior:
Expected behavior In jupyterlab there should be an option to export notebook as ansible playbooks.
Screenshots
Expected behaviour in jupyter notebook:
Missing menu item in jupyterlab:
Desktop (please complete the following information):