Skip to content

[Bug] wxGUI/jupyter_notebook: missing Jupyter Notebook default templates if compilation process with CMake was used #7808

Description

@tmszi

Describe the bug

Missing wxGUI Jupyter Notebook default templates if compilation process with CMake was used.

To reproduce

  1. Launch wxGUI
  2. Launch Jupyter Notebook window
  3. Select Save project in radio button widget
  4. Check Create welcome notebook checkbox widget
  5. Hit Open Integrated Notebook
  6. See error
Traceback (most recent call last):
  File
"/usr/lib64/grass86/gui/wxpython/main_window/frame.py", line
1047, in OnJupyterNotebook
    success = self._setup_jupyter_integrated_mode(storage,
create_template)
  File
"/usr/lib64/grass86/gui/wxpython/main_window/frame.py", line
939, in _setup_jupyter_integrated_mode
    if not panel.SetUpEnvironment():
           ~~~~~~~~~~~~~~~~~~~~~~^^
  File
"/usr/lib64/grass86/gui/wxpython/jupyter_notebook/panel.py",
line 108, in SetUpEnvironment
    self.env.setup()
    ~~~~~~~~~~~~~~^^
  File "/usr/lib64/grass86/gui/wxpython/jupyter_notebook/env
ironment.py", line 39, in setup
    self.storage_manager.prepare_files()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/grass86/gui/wxpython/jupyter_notebook/sto
rage.py", line 89, in prepare_files
    self.create_welcome_notebook()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/grass86/gui/wxpython/jupyter_notebook/sto
rage.py", line 224, in create_welcome_notebook
    return self._create_from_template(template_name,
replacements=replacements)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/grass86/gui/wxpython/jupyter_notebook/sto
rage.py", line 186, in _create_from_template
    target_path = self.import_file(template_path)
  File "/usr/lib64/grass86/gui/wxpython/jupyter_notebook/sto
rage.py", line 108, in import_file
    raise FileNotFoundError(_("File not found:
{}").format(source))
FileNotFoundError: File not found: /usr/lib64/grass86/gui/wx
python/jupyter_notebook/template_notebooks/welcome.ipynb
tomas@gentoo-gnu-linux:~$ ls -ld /usr/lib64/grass86/gui/wxpython/jupyter_notebook/*/
drwxr-xr-x 2 root root 4096 Aug  6 20:45 /usr/lib64/grass86/gui/wxpython/jupyter_notebook/__pycache__/

Expected behavior

wxGUI Jupyter Notebook default templates should be copied if compilation process with CMake was used. And Jupyter Integrated Notebook should be started without error message.

tomas@gentoo-gnu-linux:~$ ls -ld /usr/lib64/grass86/gui/wxpython/jupyter_notebook/*/
drwxr-xr-x 2 root root 4096 Aug  6 20:45 /usr/lib64/grass86/gui/wxpython/jupyter_notebook/__pycache__/
drwxr-xr-x 2 root root 4096 Aug  6 20:45 /usr/lib64/grass86/gui/wxpython/jupyter_notebook/template_notebooks/

System description

Additional context

wxGUI CMakeLists.txt config file doesn't handle copying template_notebooks directory with *.ipynb files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CMakeGUIwxGUI relatedbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions