This guide helps resolve common installation issues with Spyglass.
Run the validation script to identify issues:
python scripts/validate.pyThe validator will check:
- ✓ Python version compatibility
- ✓ Conda/Mamba availability
- ✓ Spyglass import
- ⚠ SpyglassConfig (optional)
- ⚠ Database connection (optional)
Symptoms:
conda env createhangs or fails- Package conflict errors
- Timeout during solving environment
Solutions:
-
Update conda/mamba:
conda update conda # or mamba update mamba -
Clear package cache:
conda clean --all
-
Try mamba (faster, better at resolving conflicts):
conda install mamba -c conda-forge mamba env create -f environments/environment.yml
-
Use minimal installation first:
python scripts/install.py --minimal
-
Check disk space:
- Minimal: ~10 GB required
- Full: ~25 GB required
df -h
Symptoms:
- "Docker not available"
- Container fails to start
- MySQL timeout waiting for readiness
Solutions:
-
Verify Docker is installed and running:
docker --version docker ps
-
Start Docker Desktop (macOS/Windows)
- Check system tray for Docker icon
- Ensure Docker Desktop is running
-
Check Docker permissions (Linux):
sudo usermod -aG docker $USER # Then log out and back in
-
Container already exists:
# Check if container exists docker ps -a | grep spyglass-db # Remove old container docker rm -f spyglass-db # This will delete all data in the container! # Try installation again python scripts/install.py --docker
-
Port 3306 already in use:
# Check what's using port 3306 lsof -i :3306 # or netstat -an | grep 3306 # Stop conflicting service or use different port
-
Container starts but MySQL times out:
# Check container logs docker logs spyglass-db # Wait longer and check again docker exec spyglass-db mysqladmin -uroot -ptutorial ping
Symptoms:
- "Connection refused"
- "Access denied for user"
- TLS/SSL errors
Solutions:
-
Verify credentials:
- Double-check host, port, username, password
- Try connecting with mysql CLI:
mysql -h HOST -P PORT -u USER -p
-
Check network/firewall:
# Test if port is open telnet HOST PORT # or nc -zv HOST PORT
-
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:
-- Run on MySQL server GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
Symptoms:
- "Python 3.10+ required, found 3.9"
- Import errors for newer Python features
Solutions:
-
Check Python version:
python --version
-
Install correct Python version:
# Using conda conda install python=3.10 # Or create new environment conda create -n spyglass python=3.10
-
Verify conda environment:
# Check active environment conda info --envs # Activate spyglass environment conda activate spyglass
Symptoms:
ModuleNotFoundError: No module named 'spyglass'- Import errors for spyglass submodules
Solutions:
-
Verify installation:
conda activate spyglass pip show spyglass
-
Reinstall in development mode:
cd /path/to/spyglass pip install -e . pip show spyglass-neuro # confirm installation
-
Check sys.path:
import sys print(sys.path) # Should include spyglass source directory
Symptoms:
- "Cannot find configuration file"
- Base directory errors
Solutions:
-
Check config file location:
ls -la ~/.datajoint_config.json # or ls -la ./dj_local_conf.json
-
Set base directory:
export SPYGLASS_BASE_DIR=/path/to/data -
Create default config:
from spyglass.settings import SpyglassConfig config = SpyglassConfig() # Auto-creates if missing
Symptoms:
- "Could not connect to database"
- Configuration file not found
Solutions:
-
Check DataJoint config:
cat ~/.datajoint_config.json -
Manually create config (
~/.datajoint_config.json):{ "database.host": "localhost", "database.port": 3306, "database.user": "root", "database.password": "tutorial", "database.use_tls": false } -
Test connection:
import datajoint as dj dj.conn().ping()
Symptoms:
- Architecture mismatch errors
- Rosetta warnings
- Package installation failures
Solutions:
-
Use native ARM environment:
# Ensure using ARM conda conda config --env --set subdir osx-arm64 -
Some packages may require Rosetta:
# Install Rosetta 2 if needed softwareupdate --install-rosetta -
Use mamba for better ARM support:
conda install mamba -c conda-forge mamba env create -f environments/environment.yml
Symptoms:
- Installation fails partway through
- "No space left on device"
Solutions:
-
Check available space:
df -h
-
Clean conda cache:
conda clean --all
-
Choose different installation directory:
python scripts/install.py --base-dir /path/with/more/space
-
Use minimal installation:
python scripts/install.py --minimal
Symptoms:
- "Permission denied" during installation
- Cannot write to directory
Solutions:
-
Check directory permissions:
ls -la /path/to/directory
-
Create directory with correct permissions:
mkdir -p ~/spyglass_data chmod 755 ~/spyglass_data
-
Don't use sudo with conda:
- Conda environments should be user-owned
- Never run
sudo condaorsudo pip
Symptoms:
- Cannot clone repository
- Git not found
Solutions:
-
Install git:
=== "maxOS"
```bash xcode-select --install ```=== "Windows"
```powershell choco install git ```=== "Linux - Debian/Ubuntu"
```bash sudo apt-get update -y sudo apt-get install git -y ```=== "Linux - CentOS/RHEL"
```bash sudo yum install git -y ``` -
Clone with HTTPS instead of SSH:
git clone https://github.com/LorenFrankLab/spyglass.git
=== "maxOS"
**Issue: Xcode Command Line Tools missing**
```bash
xcode-select --install
```
**Issue: Homebrew conflicts**
```bash
# Use conda-installed tools instead of homebrew
conda activate spyglass
which python # Should show conda path
```
=== "Linux"
**Issue: Missing system libraries**
```bash
# Ubuntu/Debian
sudo apt-get install build-essential libhdf5-dev
# CentOS/RHEL
sudo yum groupinstall "Development Tools"
sudo yum install hdf5-devel
```
**Issue: Docker permissions**
```bash
sudo usermod -aG docker $USER
# Log out and back in
```
=== "Windows (WSL)"
**Issue: WSL not set up**
```bash
# Install WSL 2 from PowerShell (admin):
wsl --install
```
**Issue: Docker Desktop integration**
- Enable WSL 2 integration in Docker Desktop settings
- Ensure Docker is running before installation
-
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.
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