Skip to content

Troubleshooting

igaurab edited this page Nov 19, 2026 · 2 revisions

Each section gives a problem, its cause and the solution.

shift+enter does not run the cell

Cause: The terminal does not send shift+enter or ctrl+enter as separate keys. Ghostty, Kitty, WezTerm and iTerm2 send them. Terminal.app does not.

Solution: Use one of these:

Mode Key
All modes alt+enter (runs the cell and adds a cell below)
Editor, normal mode space r c
Cell mode ctrl+e (run), ctrl+n (new cell), r c

A key does a different thing in the editor

Cause: In the editor, the vim meaning of a key applies. For example, ctrl+d scrolls there and does not delete the cell.

Solution: Press escape to go to cell mode, then press the key. See What changed for vim. If you do not want vim keys, type :set novim.

ctrl+h or backspace moves to a different window

Cause: Terminals send ctrl+h as backspace. Outside insert mode, the two keys go to the window on the left.

Solution: This is the intended function. In insert mode, the two keys delete a character.

The file explorer shows empty boxes or ? in front of folders

Cause: The folder icons are characters of a Nerd Font. The font of your terminal does not have them.

Solution: Use one of these:

  • Type :set noicons. The explorer then shows ▸ and ▾. gpython saves the setting.
  • Set a Nerd Font as the font of your terminal.

Images show as colored blocks or as buttons

Cause: The terminal has no graphics protocol that gpython can use, or gpython runs in tmux. In tmux, gpython does not use the kitty graphics protocol.

Solution:

  • Use a terminal with the kitty graphics protocol: Kitty, Ghostty, Rex, WezTerm or Konsole.
  • Run gpython outside tmux.
  • Or use v in cell mode, then o, to open the image in the browser.

To examine what a terminal supports, run uv run python scripts/kitty_probe.py from a source checkout.

Images are in the incorrect position

Solution: Set GPYTHON_KITTY_IMAGES=0 to use the fallback method:

GPYTHON_KITTY_IMAGES=0 gpython nb.py

The kernel label is red

Cause: The kernel did not start in the selected environment.

Solution:

  1. Press f6 and select a different environment.
  2. In a uv project, read the message that gpython shows. It contains what uv printed.
  3. If the environment has no ipykernel, select it in the picker. gpython installs ipykernel.

The kernel does not use my project environment

Cause: gpython shows a message with the cause when it starts. The usual causes are in this table.

Cause Solution
The .venv has no ipykernel Press f6 and select the environment. gpython installs ipykernel there
The uv project has no environment yet Run uv sync in the project, or start gpython with --extra or --with
The notebook used a different environment last time Press f6 and select the project environment
You gave uv flags, but the folder is not a uv project Add a pyproject.toml, or install uv

See Which environment a notebook starts in.

A package is installed, but the import fails

Cause: The package is in a different environment than the kernel.

Solution: Look at the kernel label in the header. Install into that environment with :pip name or %uv pip install name. These commands always use the environment of the kernel.

ModuleNotFoundError for a standard-library module

Cause: That Python was built without the module.

Solution: gpython tells you this and does not try to install it. Use a different Python (f6).

A setting does not stay after a restart

Causes and solutions:

Cause Solution
You used a command-line option (--theme, --no-vim). These apply to one session Use :theme name or :set novim
The config file has a syntax error. gpython then ignores the full file Correct ~/.config/gpython/config.toml
XDG_CONFIG_HOME is set. gpython reads a different file Edit $XDG_CONFIG_HOME/gpython/config.toml

My comments in the config file are gone

Cause: gpython writes the full file again each time it saves a setting. It does not keep comments.

Solution: Keep your notes in a different file.

A plain script opens with different cells

Cause: A different editor changed the file. The saved cell layout applies only to the exact text that gpython wrote.

Solution: None is necessary. gpython divides the file at top-level statements. If you want fixed cell borders in the file, use # %% lines. See File formats.

A fix in a new version does not show

Cause: The gpython command on your PATH is an older installation.

Solution:

  1. Run gpython --version.
  2. Update: uv tool upgrade gpynb.
  3. If you work from a source checkout, install it as editable: uv tool install --editable .

Parallel NumPy cells make the computer slow

Cause: Concurrent mode is on and the environment of the kernel has no threadpoolctl. The math libraries then use too many threads.

Solution: Install it into the environment of the kernel: :pip threadpoolctl.

asyncio.run() fails in a cell

Cause: The kernel already runs an event loop. Version 0.2.0 and older cannot start a second one. Versions after 0.2.0 support asyncio.run() in a cell.

Solution: Write await coroutine() at the top level of the cell. This works in all versions.

Record a session for a bug report

GPYTHON_TTY_LOG=session.log gpython nb.py

gpython writes each byte that it sends to the terminal into the file. cat session.log plays the session again.

The file contains everything that was on the screen. Examine it before you share it.

Clone this wiki locally