Troubleshooting Guide
This guide provides solutions to common problems and errors you may encounter while using Modan2.
Installation Issues
Python Import Errors
Problem: ImportError: No module named 'PyQt5'
or similar module not found errors
Solution:
Ensure you have installed all dependencies:
pip install -r requirements.txt
If using a virtual environment, verify it is activated:
# Windows venv\Scripts\activate # Linux/macOS source venv/bin/activate
Try reinstalling the specific missing package:
pip install PyQt5 --upgrade
Problem: ModuleNotFoundError: No module named 'OpenGL'
Solution (Linux):
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3-opengl libglu1-mesa freeglut3
# Fedora
sudo dnf install python3-pyopengl mesa-libGLU freeglut
Solution (Windows/macOS):
pip install PyOpenGL PyOpenGL-accelerate
Qt Platform Plugin Issues (Linux/WSL)
Problem: qt.qpa.plugin: Could not load the Qt platform plugin "xcb"
Symptoms:
Application fails to start
Error message about Qt plugins
Black screen or crash on startup
Solution 1: Use fix script
python fix_qt_import.py
This script sets the correct Qt plugin path for your system.
Solution 2: Install XCB libraries
# Ubuntu/Debian
sudo apt-get install -y libxcb-xinerama0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 \
libxcb-render-util0 libxcb-xfixes0 libxcb-shape0 libxcb-cursor0
Solution 3: Set environment variable
export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms
python Modan2.py
Permission Issues
Problem: “Permission denied” when opening database or saving files
Windows Solution:
Right-click Modan2.exe → “Run as administrator” (not recommended for normal use)
Or change folder permissions:
Right-click folder → Properties → Security
Ensure your user has “Full control”
Linux/macOS Solution:
# Check permissions
ls -la ~/.local/share/Modan2
# Fix permissions if needed
chmod -R u+rw ~/.local/share/Modan2
chmod -R u+rw ~/.config/Modan2
Problem: Settings not saving
Location of settings files:
Windows:
%APPDATA%\Modan2\settings.json
Linux/macOS:
~/.config/Modan2/settings.json
Solution:
Check write permissions on the config directory
Manually create the directory if it doesn’t exist:
# Windows (PowerShell) mkdir "$env:APPDATA\Modan2" # Linux/macOS mkdir -p ~/.config/Modan2
Delete corrupted settings file to regenerate defaults:
# Windows (PowerShell) rm "$env:APPDATA\Modan2\settings.json" # Linux/macOS rm ~/.config/Modan2/settings.json
Database Issues
Database File Corrupted
Problem: “Database is locked” or “Database disk image is malformed”
Symptoms:
Cannot open Modan2
Error messages about database
Data not saving
Solution 1: Close other instances
Ensure no other Modan2 processes are running:
# Windows
tasklist | findstr Modan2
# If found: taskkill /F /IM Modan2.exe
# Linux/macOS
ps aux | grep Modan2
# If found: kill <pid>
Solution 2: Backup and restore
# 1. Locate database
# Windows: %APPDATA%\Modan2\modan.db
# Linux: ~/.local/share/Modan2/modan.db
# 2. Make backup
cp modan.db modan.db.backup
# 3. Try SQLite repair
sqlite3 modan.db "PRAGMA integrity_check;"
# 4. If corrupted beyond repair, restore from backup
cp modan.db.backup modan.db
Solution 3: Export and reimport
If you have a recent backup:
Use backup database
Export all datasets as JSON+ZIP
Create new database (delete modan.db)
Import datasets from JSON+ZIP
Cannot Access Database
Problem: “Unable to open database file” error
Causes:
Database file missing
Incorrect permissions
Disk full
File locked by another process
Solution:
Check file exists:
# Linux/macOS ls -la ~/.local/share/Modan2/modan.db
Check disk space:
# Linux df -h ~ # Windows (PowerShell) Get-PSDrive C
Create directory if missing:
mkdir -p ~/.local/share/Modan2
Let Modan2 create new database:
Start Modan2
New database created automatically
Import data from backups
Data Loading and Import Issues
Import File Format Not Recognized
Problem: “Unknown file format” or “Failed to import” error
Supported formats:
Landmark data: TPS, NTS, X1Y1, Morphologika, JSON+ZIP
3D models: OBJ, PLY, STL
Images: JPG, PNG, BMP, TIF
Solution:
Verify file format:
Check file extension matches content
Open in text editor to verify format
TPS file issues:
# Valid TPS format LM=5 100.5 200.3 150.2 180.9 ... ID=specimen1 IMAGE=path/to/image.jpg
Common issues:
Missing LM= line
Incorrect coordinate format
Missing ID= or IMAGE= lines
Try different format:
Convert to TPS using tpsUtil
Or use Morphologika format
Missing Data After Import
Problem: Objects imported but no landmarks visible
Causes:
Landmark coordinates all zero
Incorrect dimension (2D vs 3D)
Scale mismatch
Solution:
Check coordinates in table:
Open object dialog
View landmark table
Verify non-zero coordinates
Check dimension:
Dataset should match file (2D/3D)
Recreate dataset with correct dimension
Check scale:
Landmarks may be outside viewing range
Try “Fit to View” or zoom out
Check coordinate values are reasonable
Image/Model Not Loading
Problem: “Failed to load image” or “Model file not found”
Solution:
Check file paths:
Image/model paths stored in database
If files moved, update paths
Use relative paths when possible
Verify file integrity:
# Check file size ls -lh image.jpg # Try opening in another program # Images: Image viewer # 3D models: MeshLab, Blender
Supported formats:
Images: JPG, PNG, BMP, TIF (RGB or grayscale)
3D models: OBJ, PLY, STL (text or binary)
Re-attach files:
Right-click object → Properties
Attach image/model again
Browse to correct file
Analysis Errors
PCA/CVA/MANOVA Fails
Problem: Analysis fails with error message
Common causes:
Not enough objects:
PCA: Need at least 3 objects
CVA/MANOVA: Need at least 2 groups with 3+ objects each
Missing landmarks:
Some landmarks marked as missing
Not enough complete configurations
Solution: Estimate missing landmarks or exclude objects
No grouping variable (CVA/MANOVA):
Need categorical variable for groups
Solution: Add grouping variable to objects
Insufficient variation:
All objects identical or nearly identical
Solution: Check data quality
Solution:
Check object count:
Select dataset
View object count in status bar
Ensure sufficient objects
Check for missing data:
Review objects for missing landmarks
Use “Estimate Missing” feature or exclude
Verify grouping variable:
CVA/MANOVA require categorical variable
Create variable in dataset dialog
Assign values to objects
Procrustes Alignment Issues
Problem: “Procrustes failed” or incorrect alignment
Causes:
Collinear landmarks (all on one line)
Insufficient landmarks (< 3 for 2D, < 4 for 3D)
All landmarks at same position
Scale issues
Solution:
Check landmark quality:
View objects in viewer
Ensure landmarks properly distributed
No duplicates at same position
Try different method:
Full Procrustes → Partial Procrustes
Or use Bookstein registration
Or try Resistant Fit
Check for outliers:
Some objects very different from others
May cause alignment issues
Try excluding outliers
Analysis Results Look Wrong
Problem: Unexpected PCA/CVA results
Possible causes:
Incorrect Procrustes method
Wrong grouping variable
Outliers affecting results
Missing landmarks not handled properly
Solution:
Verify Procrustes settings:
Check which superimposition used
Try different method
Check for outliers:
View PC score plots
Look for extreme points
Investigate unusual specimens
Verify grouping:
CVA: Ensure correct grouping variable selected
Check group assignments
Check sample size:
Small samples may give unstable results
Need larger sample for robust analysis
3D Visualization Issues
3D Viewer Black Screen
Problem: 3D viewer shows black screen or nothing visible
Solution:
Reset view:
Double-click in 3D viewer
Or use View → Reset Camera
Check OpenGL:
# Linux - verify OpenGL working glxinfo | grep "OpenGL version" # Install if needed sudo apt-get install mesa-utils libglu1-mesa
Update graphics drivers:
Windows: NVIDIA, AMD, or Intel website
Linux: Use distribution’s driver manager
macOS: Use Software Update
Check model loaded:
Verify 3D model file attached
Try different model
Check file is valid OBJ/PLY/STL
OpenGL Errors
Problem: “OpenGL error” or “Failed to initialize OpenGL context”
Linux Solution:
# Install OpenGL libraries
sudo apt-get install mesa-utils libglu1-mesa-dev \
freeglut3-dev mesa-common-dev
# Test OpenGL
glxinfo | grep "OpenGL version"
Windows Solution:
Update graphics drivers
Try forcing software rendering (slower but works):
set LIBGL_ALWAYS_SOFTWARE=1 Modan2.exe
macOS Solution:
OpenGL should work out of the box on macOS 10.14+
Update macOS to latest version if issues
Landmark Spheres Not Visible
Problem: Cannot see landmark spheres in 3D viewer
Solution:
Increase sphere size:
Settings → Visualization → Landmark size
Increase value
Check lighting:
Spheres may be too dark
Adjust lighting in settings
Zoom in:
Spheres may be too small at current zoom
Scroll to zoom closer
Check wireframe:
Wireframe may obscure spheres
Toggle wireframe visibility
Performance Issues
Application Slow to Start
Problem: Modan2 takes long time to start
Causes:
Large database
Many datasets/objects loaded
Disk I/O issues
Solution:
Check database size:
Location: See FAQ
Large database (>1GB) may slow startup
Optimize database:
sqlite3 modan.db "VACUUM;"
Move to SSD:
Database on HDD is slower
Move to SSD for better performance
Reduce loaded data:
Close unused datasets
Archive old analyses
Slow Analysis or Visualization
Problem: Analysis takes very long or UI freezes
Expected performance:
100 objects: < 1 second
1000 objects: 1-5 seconds
2000 objects: 5-15 seconds
If much slower:
Check object count:
Select dataset → View object count
Verify within expected range
Close other applications:
Free up RAM
Close web browsers
Stop background processes
Check system resources:
Task Manager / Activity Monitor
Look for high CPU or memory usage
Close resource-heavy apps
Simplify visualization:
Reduce polygon count for 3D models
Disable wireframes
Close object viewers not in use
Out of Memory Errors
Problem: “Out of memory” or crash with large datasets
Solution:
Check RAM usage:
Task Manager / Activity Monitor
Ensure sufficient RAM available
Close other applications:
Web browsers use lots of RAM
Close unnecessary programs
Work with subsets:
Analyze smaller groups
Export subsets of data
Upgrade RAM:
4GB: Small datasets only
8GB: Recommended for most work
16GB+: Large datasets
UI and Display Issues
UI Elements Not Displaying Correctly
Problem: Buttons, menus, or dialogs appear garbled or cut off
Solution:
Check display scaling (Windows):
Right-click desktop → Display settings
Set scaling to 100% or 125%
Restart Modan2
Update Qt:
pip install --upgrade PyQt5
Reset window geometry:
Delete settings file (see above)
Restart Modan2
Windows repositioned to defaults
Font Issues
Problem: Text appears too small or too large
Solution:
Adjust system font size:
Windows: Settings → Display → Scale
macOS: System Preferences → Displays
Linux: Display settings in DE
Application-specific (future):
Font size settings planned
Currently uses system fonts
High DPI Display Issues
Problem: UI elements tiny on 4K/high DPI displays
Solution:
Enable high DPI scaling (Windows):
Right-click Modan2.exe → Properties
Compatibility → High DPI settings
Override scaling behavior
Set environment variable:
# Windows (PowerShell) $env:QT_AUTO_SCREEN_SCALE_FACTOR=1 python Modan2.py # Linux/macOS export QT_AUTO_SCREEN_SCALE_FACTOR=1 python Modan2.py
Advanced Troubleshooting
Collecting Debug Information
When reporting issues, include this information:
System Information:
# Python version python --version # OS version # Windows: winver # macOS: sw_vers # Linux: lsb_release -a
Modan2 version:
Help → About Modan2
Note version number
Log files:
Windows:
%APPDATA%\Modan2\logs\
Linux/macOS:
~/.local/share/Modan2/logs/
Help → View Logs
Package versions:
pip list | grep -E "PyQt5|numpy|scipy|peewee"
Enabling Debug Logging
To get more detailed logs:
Via Settings (future feature):
Settings → Advanced → Logging
Set “Log level” to “DEBUG”
Via Environment Variable:
# Linux/macOS export MODAN2_LOG_LEVEL=DEBUG python Modan2.py # Windows (PowerShell) $env:MODAN2_LOG_LEVEL="DEBUG" python Modan2.py
View logs in real-time:
# Linux/macOS tail -f ~/.local/share/Modan2/logs/modan2_*.log # Windows PowerShell Get-Content -Path "$env:APPDATA\Modan2\logs\modan2_*.log" -Wait
Running in Safe Mode
To disable optimizations and troubleshoot:
# Run from command line to see errors
python Modan2.py
# With debug output
python Modan2.py --verbose
# Without 3D visualization (if OpenGL issues)
python Modan2.py --no-3d
Common Error Messages
“Failed to connect to database”
Cause: Database file locked or inaccessible
Solution: See “Database Issues” section above
“Procrustes superimposition failed”
Cause: Insufficient or collinear landmarks
Solution: See “Procrustes Alignment Issues” section above
“Not enough objects for analysis”
Cause: Insufficient sample size
Solution:
PCA: Need at least 3 objects
CVA/MANOVA: Need at least 2 groups with 3+ objects each
“Invalid landmark count”
Cause: Object has wrong number of landmarks for dataset
Solution:
Check dataset landmark count
Verify object landmarks match
Re-digitize object if needed
Getting Additional Help
If this guide doesn’t solve your problem:
Check FAQ:
Quick answers to common questions
Check GitHub Issues:
https://github.com/jikhanjung/Modan2/issues
Search for similar problems - they may already be solved
Create New Issue:
Include:
Operating system and version
Python version (
python --version
)Modan2 version
Error message or description
Steps to reproduce
Log files (see “Collecting Debug Information” above)
GitHub Discussions:
For questions and general discussion:
Email Support:
Contact: jikhanjung@gmail.com
(Please try above resources first)
Known Issues and Limitations
Current Limitations
Missing landmark estimation:
Limited to TPS interpolation
More methods planned
3D Export Formats:
Analysis results to CSV/Excel only
More formats planned
Platform-Specific:
macOS builds not code-signed (requires manual approval)
Linux may need manual Qt plugin configuration
GUI Only:
No command-line interface yet
Cannot run in headless mode
Language:
UI primarily English
Korean translation partially complete
More languages planned
Planned Improvements
See CHANGELOG and GitHub milestones for planned features:
Command-line interface for batch processing
Enhanced 3D visualization
More analysis methods
Improved documentation
Better cross-platform support
Plugin system
Contributing
Found a bug or have suggestions? Contributions welcome!
Report bugs: https://github.com/jikhanjung/Modan2/issues
Submit fixes: https://github.com/jikhanjung/Modan2/pulls
Improve docs: Edit this file and submit PR
See CONTRIBUTING.md for detailed contribution guidelines (when available).