KINTSUGI Troubleshooting Guide
This guide covers common issues and their solutions when installing or running KINTSUGI.
Table of Contents
Installation Issues
Conda Environment Creation Fails
Symptom: conda env create command fails with dependency conflicts.
Solutions:
Use libmamba solver (faster and more reliable):
conda install -n base conda-libmamba-solver conda config --set solver libmamba conda env create -f envs/env-linux.yml
Update conda:
conda update -n base conda
Try the streamlined environment:
conda env create -f env_streamlined.yml
Create minimal environment and add packages:
conda create -n KINTSUGI python=3.10 conda activate KINTSUGI pip install -e . # Install additional dependencies as needed
Package Installation Errors
Symptom: pip install -e . fails.
Solutions:
Ensure setuptools is updated:
pip install --upgrade pip setuptools wheel
Check Python version:
python --version # Should be 3.10+
Install with verbose output:
pip install -e . -v
Dependency Issues
libvips Not Found
Symptom: Error message like cannot find library libvips or pyvips.GObject.Error.
Windows
Download from Zenodo:
Download PyVips-dev-8.16 from Zenodo
Extract to KINTSUGI folder
Set PATH manually:
$env:PATH = "C:\Users\[username]\KINTSUGI\vips-dev-8.16\bin;$env:PATH"
Add to system PATH permanently:
Open System Properties > Environment Variables
Add
C:\Users\[username]\KINTSUGI\vips-dev-8.16\binto PATH
Linux
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libvips-dev
# Fedora/RHEL
sudo dnf install vips-devel
# Verify installation
vips --version
macOS
brew install vips
Verify libvips Installation
import pyvips
print(f"libvips version: {pyvips.version(0)}.{pyvips.version(1)}.{pyvips.version(2)}")
Java/JVM Issues
Symptom: java.lang.Exception or JVMNotFoundException.
Check Java Installation
java -version
echo $JAVA_HOME # Linux/macOS
echo %JAVA_HOME% # Windows
Fix Missing Java
Install via conda (recommended):
conda install openjdk=11
Download from Zenodo (Windows):
Download java-jdk21 from Zenodo
Extract to KINTSUGI folder
Set JAVA_HOME:
# Linux/macOS export JAVA_HOME=/path/to/java export PATH=$JAVA_HOME/bin:$PATH # Windows PowerShell $env:JAVA_HOME = "C:\Users\[username]\KINTSUGI\java-jdk21" $env:PATH = "$env:JAVA_HOME\bin;$env:PATH"
JVM Already Started Error
Symptom: JVMAlreadyStarted exception.
This occurs when trying to start JVM multiple times. Solutions:
Restart Python kernel (in Jupyter)
Single JVM initialization:
import jpype if not jpype.isJVMStarted(): jpype.startJVM()
CUDA/GPU Issues
Symptom: torch.cuda.is_available() returns False.
Verify GPU Detection
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"CUDA version: {torch.version.cuda}")
if torch.cuda.is_available():
print(f"GPU: {torch.cuda.get_device_name(0)}")
Solutions
Check NVIDIA driver:
nvidia-smi
Reinstall PyTorch with CUDA:
pip uninstall torch torchvision pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
Verify CUDA toolkit:
nvcc --versionUse CPU fallback:
Most KINTSUGI operations work without GPU
Set device manually:
device = "cpu"
Runtime Issues
Import Errors
Symptom: ModuleNotFoundError or ImportError.
General Solutions
Verify environment is activated:
conda activate KINTSUGI which python # Should show conda environment path
Run dependency check:
kintsugi checkReinstall package:
pip install -e . --force-reinstall
Specific Import Errors
ImportError: cannot import name 'Valis':
# Correct import path
from Kreg.registration import Valis
# or via kintsugi package
from kintsugi.kreg import Valis
ModuleNotFoundError: No module named 'Kreg':
import sys
sys.path.insert(0, '/path/to/KINTSUGI/notebooks')
Memory Issues
Symptom: MemoryError or process killed during processing.
Solutions
Reduce image dimensions:
config = { "max_image_dim_px": 2048, # Reduce from default "max_processed_image_dim_px": 1024, }
Process images in tiles:
Use tiled processing for large images
Reduce batch size
Monitor memory usage:
import psutil print(f"Memory: {psutil.virtual_memory().percent}%")
Clear pyvips cache:
import pyvips pyvips.cache_set_max(0)
Use zarr for large datasets:
import zarr # Process in chunks
Registration Failures
Symptom: Registration produces poor results or fails.
Check Input Images
Verify image format:
import tifffile img = tifffile.imread('image.tif') print(f"Shape: {img.shape}, dtype: {img.dtype}")
Check image quality:
Ensure images are not corrupted
Verify adequate contrast and features
Adjust Parameters
Try different registrars:
config = { "micro_rigid_registrar_cls": "RigidRegistrar", # or "AffineRegistrar" }
Adjust image dimensions:
config = { "max_image_dim_px": 4096, # Increase for more detail }
Disable non-rigid registration:
config = { "compose_non_rigid": False, }
Platform-Specific Issues
Windows
Long Path Issues
Symptom: FileNotFoundError with long paths.
Solution:
Enable long paths in Windows:
Run
gpedit.mscNavigate to: Computer Configuration > Administrative Templates > System > Filesystem
Enable “Enable Win32 long paths”
Or move KINTSUGI to shorter path (e.g.,
C:\KINTSUGI)
DLL Load Failures
Symptom: ImportError: DLL load failed.
Solutions:
Install Visual C++ Redistributable
Verify all Zenodo dependencies are extracted
Add paths to system PATH
Linux
Permission Issues
Symptom: Permission denied errors.
Solutions:
# Fix permissions
chmod +x scripts/install.sh
chmod -R u+rw KINTSUGI/
# Don't run as root
# If needed, use: sudo chown -R $USER:$USER KINTSUGI/
Display Issues (Napari)
Symptom: Napari doesn’t display.
Solutions:
# Check display
echo $DISPLAY
# For headless servers, use Xvfb
Xvfb :99 -screen 0 1024x768x24 &
export DISPLAY=:99
macOS
Apple Silicon (M1/M2)
Symptom: Package incompatibility on ARM.
Solutions:
Use Rosetta 2 for x86 compatibility:
arch -x86_64 conda create -n KINTSUGI python=3.10
Use native ARM packages where available:
conda config --add channels apple
Gatekeeper Blocks
Symptom: “Cannot be opened because the developer cannot be verified”.
Solution:
xattr -d com.apple.quarantine /path/to/file
Getting Help
If you’re still experiencing issues:
Run full diagnostics:
kintsugi check --verbose > diagnostics.txt python -c "import sys; print(sys.version)" conda list > packages.txt
Check GitHub Issues: https://github.com/smith6jt-cop/KINTSUGI/issues
Create a new issue with:
Operating system and version
Python version
Error message (full traceback)
Steps to reproduce
Output of
kintsugi check
Quick Reference
Issue |
Quick Fix |
|---|---|
libvips not found |
Windows: Download from Zenodo; Linux: |
Java not found |
|
GPU not detected |
Check |
Import errors |
|
Memory errors |
Reduce |
Environment conflicts |
Use |