Troubleshooting#
This page collects a few known issues and solutions for common problems that users might encounter when using napari. If you are facing an error that is not covered by this page, please check existing issues on the napari repository. If you can’t find what you are looking for, please open a new issue.
Known issues#
Plugin options missing#
If you’ve installed a plugin, restarted napari, and some of the plugin’s
options are missing e.g. there is no Tools menu or you’re trying to save
layers and can’t find the plugin in the listed writers, you might have an
auto-converted plugin using the deprecated npe1 engine.
You can check if this is the problem by installing napari<=0.6.6 and turning
off the Use npe2 adaptor setting under
Preferences -> Plugins -> Use npe2 adaptor and restarting napari. If this
fixes your issue, you’ll need reach out to the plugin developer to update their
plugin in order to use it with napari>=0.7.0.
Learn more about this in the adapted plugin guide.
Resetting preferences and settings#
Changing napari versions—updating or downgrading—within an environment can cause issues with settings. These issues can manifest as napari failing to start.
Likewise, issues with napari on multiple monitors or with window sizes are also due to settings. These issues can frequently be solved by resetting the settings back to default using the terminal command:
napari --reset
torch + rosetta + napari crashes Python#
In some cases, when using napari on Mac M1 using Rosetta you may experience crashing when adding layers or using a script. If you observe this, you should run napari using the native arm64 Python interpreter (see napari#7259.
“module napari has no attribute Viewer”#
This may happen when doing an editable install on top of a normal one, or when
you have a local file called napari.py.
To fix this, either rename the file or remove all previous napari versions in your environment before installing the editable version.
My image renders as all black/all white#
This can happen when the contrast limits are not set correctly. You can reset the contrast limits by right-clicking “contrast limits”, then clicking the “Reset” button in the advanced contrast limits widget shown.
See Adjusting contrast limits for more information on contrast limits.
PermissionError when trying to launch napari on Windows#
If you have a PermissionError when trying to launch napari on Windows, it could
be due to how numba deals with permissions. Try setting NUMBA_CACHE_DIR to an
user-accessible location.
See napari#7288.
Mixed napari installations#
Since napari 0.6.2 we have added a check for the mix of
editable
and non-editable napari installations in the same environment. This occurs when
you install napari using pip install -e path/to/napari while napari related
files are still present in the typical Python package installation directory
(called site-packages).
Because of how importing in python works, two installations from even slightly different versions of napari will often lead to a crash on startup or other unexpected behavior
If you meet an exception starting from
RuntimeError: Mix of local and non local installation detected. you have two
options:
Recreate your environment and install napari from scratch; this is the safest option. But you need to know which packages you need to install in your environment. You may use
pip freezeto get the list of packages installed in your environment.Remove the non-editable napari installation from your environment. In the exception message you will see the path to the non-editable installation. For example
Path to a napari directory: /home/czaki/.pyenv/versions/3.12.9/envs/napari_3.12/lib/python3.12/site-packages/napari.You can fix the error by manually deleting thenaparidirectory. In some rare situations this solution may not fix the environment, so you may need to recreate, as described in the first option.
Running napari on Wayland with Nvidia cards#
The Nvidia driver is not yet fully ready for Wayland. We found that on computers with Nvidia cards and a Wayland-based desktop environment, napari may fail to start with errors such as this:
OpenGL.error.GLError: GLError(
err = 1280,
baseOperation = glGetString,
cArguments = (GL_VERSION,),
result = b'OpenGL ES 3.2 NVIDIA 580.126.09'
)
The problem can be worked around by forcing Qt to use X11 (via XWayland) and PyOpenGL to use GLX, by setting the following environment variables:
QT_QPA_PLATFORM=xcb
PYOPENGL_PLATFORM=glx
Important
This workaround needs XWayland (the X11 compatibility layer) installed and
running, since xcb connects to an X server rather than to Wayland directly.
Most desktop environments ship and start it by default; if yours doesn’t,
forcing xcb fails with Could not load the Qt platform plugin "xcb". Install
it via your package manager (e.g. xwayland on Debian/Ubuntu, xorg-xwayland
on Arch) and start a new session.
When napari detects an Nvidia proprietary driver and a reachable X server, it
sets the aforementioned environment variables automatically at startup, so
launching via the napari command or a Python script usually works without any
action on your part. napari only sets these variables for the current session
if you haven’t, so your own values are always respected.
This automatic fix only works if napari is imported before any Qt application
is created. If a Qt application already exists (most commonly in IPython or
Jupyter when %gui qt runs before import napari), napari can’t apply the
workaround and prints a warning. In that case, set the variables yourself
before starting the IPython or Jupyter session:
QT_QPA_PLATFORM=xcb PYOPENGL_PLATFORM=glx ipython
QT_QPA_PLATFORM=xcb PYOPENGL_PLATFORM=glx jupyter lab