Skip to content

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:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Use the install script above instead of pip

Restart your terminal after installation and verify uv is working:

uv --version

Step 2: Install PMCGrab

Now install PMCGrab with uv (faster resolver):

uv add pmcgrab

If you prefer the standard toolchain:

# From PyPI (once the wheel is published)


# Or directly from GitHub main branch


# Local checkout

For adding to an existing project:

uv add pmcgrab

For standalone installation:

uv

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:

git clone https://github.com/rajdeepmondaldotcom/pmcgrab.git
cd pmcgrab
uv add --editable .

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:

import pmcgrab
print(pmcgrab.__version__)

Or use the command line:

uv run python -m pmcgrab --help

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:

uv add pmcgrab

uv automatically manages virtual environments, but you can create one explicitly:

uv venv pmcgrab-env
source pmcgrab-env/bin/activate  # On Windows: pmcgrab-env\Scripts\activate
uv

Next Steps

Once installed, proceed to Quick Start to begin using PMCGrab.