Skip to main content

pip-auto

Just import it. Missing packages install themselves.

pip install pip-auto

That's the whole setup. From now on, when your code imports something that isn't installed, pip-auto finds the right package on PyPI, installs it on the spot, and your program keeps running — no ModuleNotFoundError, no stopping to run pip install, no restarting.

import pyfiglet               # not installed? fine
from PIL import Image         # import name ≠ package name? fine (installs pillow)
import cv2                    # installs opencv-python
print(pyfiglet.figlet_format("hello"))
[autopip] 'pyfiglet' not found → installing pyfiglet
[autopip] installed pyfiglet==1.0.4 (2.51s)

Why it's nice

  • Zero setup. pip install pip-auto turns it on for that Python. pip uninstall pip-auto removes every trace.
  • It knows the real package name. PIL → pillow, cv2 → opencv-python, sklearn → scikit-learn, bs4 → beautifulsoup4, google.generativeai → google-generativeai, plus ~1,000 more mappings — and it learns new ones from every wheel it sees. Before installing, it opens the wheel and checks the module is really inside, so a same-named impostor never gets installed.
  • Fast. Its own installer (pip is not used): dependencies are prefetched and resolved in parallel, and every file of every wheel is placed in one parallel batch. From the second time on it just hard-links from a local cache. Installing requests + numpy + pandas + flask + rich (22 packages) into a fresh environment: pip 58 s → pip-auto 13 s → 2.7 s the second time. It adds only about 5 ms to Python startup.
  • Safe. Names that look like popular packages (typosquats such as requets) and brand-new unknown packages are never installed automatically. If anything fails halfway, everything — including the old versions it replaced — is rolled back.
  • Respects "optional" imports. try: import x / except ImportError: in your code, optional imports inside libraries, and importlib.util.find_spec("x") checks are left alone.
  • Works everywhere you run Python: scripts, Jupyter / IPython, virtual environments.
  • Speaks your language. Messages follow your OS language: English, 日本語, 简体中文, 繁體中文, 한국어, Español, Français, Deutsch, Português, Русский.

Tell it what you want (optional)

# /// script
# dependencies = ["requests<3", "rich"]
# ///
import requests, rich            # a PEP 723 block is installed up front, all at once
import numpy  # autopip: numpy<2   ← pin a version with an end-of-line comment

Commands

Command What it does
autopip run x.py Install everything x.py needs first, then run it (--venv creates and uses .venv next to it)
autopip lock x.py Write x.autopip.lock with every version and sha256 pinned; run then installs exactly that
autopip install ... Same syntax as pip install: -r requirements.txt (nested -r, -c, --hash, -i), -e ., -U, --no-deps, --force-reinstall, --dry-run, -t DIR, --user
autopip uninstall pkg... Remove (also -r file)
autopip list [--outdated] / show pkg Installed packages / packages with newer versions / details
autopip upgrade pkg... / --all Upgrade (--dry-run to only show)
autopip freeze [x.py] Pin what a script uses (--requirements, --pep723), or the whole environment
autopip clean [--days 30] [--yes] Remove auto-installed packages you haven't used for a while
autopip gui Browser dashboard: sizes, last used, clean-up, settings (127.0.0.1 only)
autopip check pkg Run the safety check only
autopip off / on Turn it off / back on

AUTOPIP_DISABLE=1 turns it off for a single command.

Settings (autopip config KEY VALUE)

  • ask — true to confirm before every install (asks on the console; never installs when nobody can answer)
  • safety — strict (default) / warn / off
  • link_mode — hardlink (default, fastest) / copy (separate files per environment)
  • lang — en, ja, zh, zh-TW, ko, es, fr, de, pt, ru (default: your OS language; also AUTOPIP_LANG)
  • index_url / extra_index_urls — other package indexes (pip.ini / PIP_INDEX_URL are read too)

Compatibility

  • Python 3.8 – 3.14 (the test suite runs on all seven). Tested mainly on Windows; wheel selection on Linux / macOS is handled by packaging.
  • Modules removed from the standard library in Python 3.13 (imghdr, cgi, telnetlib, …) are provided by installing their maintained successors (standard-imghdr, legacy-cgi, …).
  • No dependencies. MIT license.

Good to know

  • Only packages from PyPI (or the indexes you configure) are installed, and every install is logged.
  • In hardlink mode, environments share the same files. If you edit installed files in place, use link_mode copy.

日本語の説明: README.ja.md (included in the source distribution)

Metadata

Release files for pip-auto 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pip-auto 0.6.0
File Size Uploaded
pip_auto-0.6.0.tar.gz 93.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pip-auto 0.6.0
File Interpreter ABI Platform
pip_auto-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 175.3 kB

Release files / pip_auto-0.6.0.tar.gz

Download URL pip_auto-0.6.0.tar.gz
Size 93.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5f59b182685058ae8aae5e0f0e085375cf107092a48cbe46d0bce2adb4b44774
BLAKE2b-256 checksum
How to use checksums
44545301a0dd7dcdd6102b232214288ae475e62d414d13a199f1f4ae0a5f5249
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / pip_auto-0.6.0-py3-none-any.whl

Download URL pip_auto-0.6.0-py3-none-any.whl
Size 81.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7dbe489599ff64ba786e0a494954af715d5079c5c4749c9e02ca3a4a02fba907
BLAKE2b-256 checksum
How to use checksums
3a876152a5eac2fb4151a22cee8c6fdc391a7ec5ca744e9e5ce6c08a3b3fad0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release history Release notifications | RSS feed

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page