Installation¶
PMCGrab supports Python 3.10+. Installation relies on uv—the 10-100× faster drop-in replacement for pip. Install uv first, then add PMCGrab.
Step 1: Install uv¶
First, install uv (the fast Python package manager).
If you already have uv installed, upgrade to the latest version first:
# Update uv by rerunning the install script above
# If you used the one-liner script originally, just rerun it:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then install uv if it's not present:
On macOS and Linux:¶
On Windows:¶
Restart your terminal after installation and verify uv is working:
Step 2: Install PMCGrab¶
Option A – Using uv (Recommended)¶
Now install PMCGrab with uv (faster resolver):
If you prefer the standard toolchain:
For adding to an existing project:
For standalone installation:
This installs the latest stable version from PyPI along with all required dependencies.
From Source¶
If you want the latest development version or need to modify PMCGrab:
Development Installation¶
For development work, install with development dependencies:
git clone https://github.com/rajdeepmondaldotcom/pmcgrab.git
cd pmcgrab
# Install with all development dependencies
uv sync --dev --all-groups
Verify Installation¶
Test your installation:
Or use the command line:
Dependencies¶
PMCGrab requires the following packages:
- beautifulsoup4 (≥4.13.4) - HTML parsing
- biopython (≥1.83) - Biological data structures
- lxml (≥4.9.0) - XML processing
- numpy (≥1.24.0) - Numerical operations
- pandas (≥2.0.0) - Data manipulation
- requests (≥2.28.0) - HTTP requests
- tqdm (≥4.64.0) - Progress bars
Optional Dependencies¶
For development and documentation:
uv add "pmcgrab[dev]" # Development tools
uv add "pmcgrab[docs]" # Documentation tools
uv add "pmcgrab[test]" # Testing dependencies
System Requirements¶
- Python: 3.10, 3.11, 3.12, or 3.13
- Operating System: Windows, macOS, or Linux
- Memory: Minimum 512MB RAM (2GB+ recommended for batch processing)
- Network: Internet connection required for PMC article retrieval
Common Issues¶
ImportError with lxml¶
If you encounter issues with lxml installation:
# On Ubuntu/Debian
sudo apt-get install libxml2-dev libxslt-dev python3-dev
# On macOS
brew install libxml2 libxslt
# Then reinstall
uv add --upgrade --force lxml
Permission Errors¶
If you get permission errors during installation:
Virtual Environment (Recommended)¶
uv automatically manages virtual environments, but you can create one explicitly:
Next Steps¶
Once installed, proceed to Quick Start to begin using PMCGrab.