Spyglass Installation Troubleshooting¶
This guide helps resolve common installation issues with Spyglass.
Quick Diagnosis¶
Run the validation script to identify issues:
The validator will check:
- ✓ Python version compatibility
- ✓ Conda/Mamba availability
- ✓ Spyglass import
- ⚠ SpyglassConfig (optional)
- ⚠ Database connection (optional)
Common Issues¶
Environment Creation Fails¶
Symptoms:
conda env createhangs or fails- Package conflict errors
- Timeout during solving environment
Solutions:
-
Update conda/mamba:
-
Clear package cache:
-
Try mamba (faster, better at resolving conflicts):
-
Use minimal installation first:
-
Check disk space:
- Minimal: ~10 GB required
- Full: ~25 GB required
Docker Database Issues¶
Symptoms:
- "Docker not available"
- Container fails to start
- MySQL timeout waiting for readiness
Solutions:
-
Verify Docker is installed and running:
-
Start Docker Desktop (macOS/Windows)
- Check system tray for Docker icon
- Ensure Docker Desktop is running
-
Check Docker permissions (Linux):
-
Container already exists:
-
Port 3306 already in use:
-
Container starts but MySQL times out:
Remote Database Connection Fails¶
Symptoms:
- "Connection refused"
- "Access denied for user"
- TLS/SSL errors
Solutions:
-
Verify credentials:
- Double-check host, port, username, password
- Try connecting with mysql CLI:
-
Check network/firewall:
-
TLS configuration:
- For
localhost, TLS should be disabled - For remote hosts, TLS should be enabled
- If TLS errors occur, verify server certificate
- For
-
Database permissions:
Python Version Issues¶
Symptoms:
- "Python 3.10+ required, found 3.9"
- Import errors for newer Python features
Solutions:
-
Check Python version:
-
Install correct Python version:
-
Verify conda environment:
Spyglass Import Fails¶
Symptoms:
ModuleNotFoundError: No module named 'spyglass'- Import errors for spyglass submodules
Solutions:
-
Verify installation:
-
Reinstall in development mode:
-
Check sys.path:
SpyglassConfig Issues¶
Symptoms:
- "Cannot find configuration file"
- Base directory errors
Solutions:
-
Check config file location:
-
Set base directory:
-
Create default config:
DataJoint Configuration Issues¶
Symptoms:
- "Could not connect to database"
- Configuration file not found
Solutions:
-
Check DataJoint config:
-
Manually create config (
~/.datajoint_config.json): -
Test connection:
M1/M2 Mac Issues¶
Symptoms:
- Architecture mismatch errors
- Rosetta warnings
- Package installation failures
Solutions:
-
Use native ARM environment:
-
Some packages may require Rosetta:
-
Use mamba for better ARM support:
Insufficient Disk Space¶
Symptoms:
- Installation fails partway through
- "No space left on device"
Solutions:
-
Check available space:
-
Clean conda cache:
-
Choose different installation directory:
-
Use minimal installation:
Permission Errors¶
Symptoms:
- "Permission denied" during installation
- Cannot write to directory
Solutions:
-
Check directory permissions:
-
Create directory with correct permissions:
-
Don't use sudo with conda:
- Conda environments should be user-owned
- Never run
sudo condaorsudo pip
Git Issues¶
Symptoms:
- Cannot clone repository
- Git not found
Solutions:
-
Install git:
-
Clone with HTTPS instead of SSH:
Platform-Specific Issues¶
Still Having Issues?¶
-
Check GitHub Issues:
-
Ask for Help:
- Include output from
python scripts/validate.py - Include relevant error messages
- Mention your OS and Python version
- Include output from
-
Manual Installation: See
DATABASE.mdand main documentation for manual setup steps.
Reset and Start Fresh¶
If all else fails, completely reset your installation:
# Remove conda environment
conda env remove -n spyglass
# Remove configuration files
rm ~/.datajoint_config.json
rm ./dj_local_conf.json
rm -rf ~/spyglass_data # Delete all Spyglass data!
# Remove Docker container
docker rm -f spyglass-db # This will delete all data in the container!
# Start fresh
git clone https://github.com/LorenFrankLab/spyglass.git
cd spyglass
python scripts/install.py