Skip to content

Instantly share code, notes, and snippets.

@kmdouglass
Last active August 3, 2022 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmdouglass/1fcd4d3abd5393879d41dbd04c04bcd4 to your computer and use it in GitHub Desktop.
Save kmdouglass/1fcd4d3abd5393879d41dbd04c04bcd4 to your computer and use it in GitHub Desktop.
Conda + Poetry specifications for Napari

Napari

Install Napari into a conda environment and manage Python packages with Poetry.

conda env create -f environment.yml
conda activate napari-env
poetry lock
poetry install

Untracked dependencies

libxcb

Napari depends on Qt5 which in turn depends on libxcb on Linux. libxcb and its related libraries should be installed through your distribution's package manager (e.g. apt) and not through Conda.

To see Qt's dependencies on libxcb and what might be missing, run the following command:

ldd <PATH_TO_CONDA>/envs/napari/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so

Alternatively, you can try launching Napari with Qt in debug mode to see the missing libraries.

QT_DEBUG_PLUGINS=1 napari

Some additional libraries that you may need to install through your package manager:

  • libxcb-icccm4
  • libxcb-image0
  • libxcb-keysyms1
  • libxcb-render0
  • libxcb-render-util0
  • libxcb-xinerama0
  • libxcb-xkb1

libxkb

You may also need this libraries from your distribution's package manager:

  • libxkbcommon0
  • libxkbcommon-x11-0
name: napari
channels:
- conda-forge
- defaults
dependencies:
- blas
- conda-lock
- gfortran
- liblapack
- poetry=1.1.14
- python=3.10
- qt=5
[tool.poetry]
name = "napari-env"
version = "0.1.0"
description = ""
authors = ["Kyle Douglass <kyle.douglass@epfl.ch>"]
[tool.poetry.dependencies]
python = "^3.10"
pooch = "*" # Required to help Poetry resolve the dependency graph; apparently this will be fixed in Poetry 1.2
napari = { version = "^0.4.16", extras = ["all"] }
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment