## Root cause of PR #3480 failure The weekly PDM update bot (`update-dependencies.yml`) ran on Python 3.x (latest, currently 3.13/3.14) while the project declared `requires-python = ">=3.11,<3.15"`. PDM's resolver evaluates candidates against the interpreter it's running on, not the project's `requires-python` floor. That let the bot pick packages that recently dropped 3.11 support: - arxiv 3.0.0 (requires >=3.10, breaks on 3.11 install attempt) - rich 15.0.0 (requires >=3.9.0 per new metadata) - virtualenv 21.2.4 (dropped 3.11) - importlib-resources 7.1.0 (requires >=3.10) The resulting `pdm.lock` was valid on 3.13 but would fail to install on 3.11/3.12, so a downstream `pdm lock --check` caught the mismatch and the bot PR needed a manual `pdm lock` follow-up commit. A prior attempt (PR #3507) tried to patch this with `pdm lock --refresh` in the bot — that only rewrites hashes; it can't un-pick packages that violate the floor. The real fix is to align the resolver's interpreter with the `requires-python` floor. ## What this PR does 1. **Raises the floor to 3.12** in `pyproject.toml` (`requires-python`, `[tool.mypy] python_version`). Python 3.11 goes EOL Oct 2027 and ecosystem packages are already dropping it; 3.12 has the largest PyPI install share (~30%) and upstream support through Oct 2028. 2. **Pins the bot runner to '3.12'** (was `3.x`) — resolver now runs at the floor, guaranteeing chosen versions install across the whole supported range. 3. **Bumps all other CI workflows from 3.11 → 3.12** so they stay at or above the new floor (17 workflows). 4. **Regenerates `pdm.lock`** under Python 3.12 — this naturally drops pins of packages whose new versions require >3.11. Net: 1003 lines removed (no more 3.11 wheel entries). 5. **Updates docs**: `docs/developing.md` prereq, `docs/SQLCIPHER_INSTALL.md` Dockerfile snippet. ## Breaking change Users on Python 3.11 can no longer `pip install local-deep-research`. Python 3.11 users should upgrade to 3.12+ before taking future releases. ## Replaces Closes #3507 (the `pdm lock --refresh` band-aid).
4.8 KiB
SQLCipher Installation Guide
Local Deep Research uses SQLCipher to provide encrypted databases for each user. This ensures that all user data, including API keys and research results, are encrypted at rest.
Installation by Platform
Ubuntu/Debian Linux
SQLCipher can be easily installed from the package manager:
sudo apt update
sudo apt install sqlcipher libsqlcipher-dev
After installing SQLCipher, install the project with PDM:
pdm install
PDM will automatically select the correct Python binding for your platform:
- x86_64 Linux:
sqlcipher3-binary(pre-compiled wheel) - ARM64 Linux:
sqlcipher3(builds from source) - Other platforms:
sqlcipher3
macOS
Install using Homebrew:
brew install sqlcipher
Then install the project with PDM:
# May need to set environment variables for building
export LDFLAGS="-L$(brew --prefix sqlcipher)/lib"
export CPPFLAGS="-I$(brew --prefix sqlcipher)/include"
pdm install
Windows
As of sqlcipher3 0.6.2+, pre-built self-contained wheels are available for Windows
(x86, x64, ARM64, Python 3.9–3.14). No compilation or system libraries needed:
pip install sqlcipher3
This is automatically included when you pip install local-deep-research.
Manual build (older versions / troubleshooting)
If you need to build from source on older Python versions:
- Install Visual Studio 2015 or later (Community Edition works)
- Install the "Desktop Development with C++" workload
- Download SQLCipher source from https://github.com/sqlcipher/sqlcipher
- Build using Visual Studio Native Tools Command Prompt
Alternatively, use WSL2 with Ubuntu.
Alternative: Using Docker
If you have difficulty installing SQLCipher, you can run Local Deep Research in a Docker container where SQLCipher is pre-installed:
FROM python:3.12-slim
# Install SQLCipher
RUN apt-get update && apt-get install -y \
sqlcipher \
libsqlcipher-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Install Local Deep Research (SQLCipher binding selected automatically)
RUN pip install local-deep-research
CMD ["ldr", "serve"]
Verifying Installation
You can verify SQLCipher is installed correctly:
# Check command line tool
sqlcipher --version
# Test Python binding
python -c "from local_deep_research.database.sqlcipher_compat import get_sqlcipher_module; get_sqlcipher_module(); print('SQLCipher is installed!')"
Fallback Mode
If SQLCipher is not available, Local Deep Research will fall back to using regular SQLite databases. However, this means your data will not be encrypted at rest. A warning will be displayed when running without encryption.
Security Notes
- Each user's database is encrypted with their password
- There is no password recovery mechanism - if a user forgets their password, their data cannot be recovered
- The encryption uses SQLCipher's default settings with AES-256
- API keys and sensitive data are only stored in the encrypted user databases
Troubleshooting
Linux: "Package not found"
If your distribution doesn't have SQLCipher in its repositories, you may need to build from source or use a third-party repository.
macOS: "Library not loaded"
Make sure you've set the LDFLAGS and CPPFLAGS environment variables as shown above.
Windows: Build errors
Ensure you're using the Visual Studio Native Tools Command Prompt and have all required dependencies installed.
Python: "No module named sqlcipher3" or "pysqlcipher3"
Error variants:
ModuleNotFoundError: No module named 'sqlcipher3'ModuleNotFoundError: No module named 'pysqlcipher3'
The project automatically selects the correct SQLCipher package based on your platform:
- x86_64 Linux: Uses
sqlcipher3-binary(pre-compiled wheel) - ARM64 Linux: Uses
sqlcipher3(builds from source with system SQLCipher) - Other platforms: Uses
sqlcipher3
Solution:
-
First, ensure you have the system SQLCipher library installed:
# Debian/Ubuntu sudo apt-get install libsqlcipher-dev # macOS brew install sqlcipher -
Then reinstall the Python package:
# If using PDM (recommended) pdm install # If NOT using PDM (e.g., pip-only setup): pip install --force-reinstall sqlcipher3-binary # x86_64 Linux pip install --force-reinstall sqlcipher3 # Other platforms
For Developers
To add SQLCipher to an automated installation script:
#!/bin/bash
# For Ubuntu/Debian
if command -v apt-get &> /dev/null; then
sudo apt-get update
sudo apt-get install -y sqlcipher libsqlcipher-dev
fi
# For macOS with Homebrew
if command -v brew &> /dev/null; then
brew install sqlcipher
fi
# Install Python package (PDM handles platform-specific dependencies automatically)
pdm install