Skip to main content

pipim: PIP IMproved

Drop-in replacement for pip with behavior that imitates other popular languages packages managers.

Rationale

When you work on Python projects, you often find yourself creating virtual environments yourself, and having to manually activate them or install dependencies in them.

This is not something you typically do with other languages, where the package manager is smart enough to know if you meant to install packages at the user level or at the project level.

This is more or less in line with the Zen of Python: explicit is better than implicit. However I grew tired of having this behavior available everywhere except with Python, so I decided to write a simple wrapper around pip that will use virtual environments by default, unless --user is passed.

Features

By default, pipim will be installed as pipim, however, you can use it as a drop-in replacement of pip, and the following examples assume you did.

Automatic use of virtual environments

The following commands will automatically create a virtual environment called .venv/ if one does not exist already, and then the actual commands inside of it:

pip install package1 [package2...]
pip uninstall package1 [package2...]

If you wish to work outside of a virtual environment, you can use the --user flag. This will try to use pipus if it is found in your PATH, and will resort to regular pip otherwise.

Install packages from requirements.txt

If you do not specify any package, this will run pip install -r requirements.txt in the virtual environment. As with other install commands, this will create the venv first if it does not exist already.

Simply run:

pip
# or
pip install

Easily installs itself as a replacement

You can use pipim replace-pip once to create a simple script in ~/.local/bin/pip that will invoke pipim instead of pip. This will allow you to forget about pipim and just run pip like you always did before, except that now it comes with extra perks ✨✨.

Run a command inside the virtual environment

pip run <command> [arguments...]

The first argument will be invoked from .venv/bin/, everything that follows is passed to it. For example:

pip run flask --help

Always fallback to regular pip

Every unmatched flags are passed down to pip, any unrecognized command will run pip too.

Contributing

Noticed a bug? Want to request a feature? Simply open a new Issue.

Metadata

Release files for pipim 1.0.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 pipim 1.0.0
File Size Uploaded
pipim-1.0.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipim 1.0.0
File Interpreter ABI Platform
pipim-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / pipim-1.0.0.tar.gz

Download URL pipim-1.0.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5cf1544cec08fe40f9a21bc842cb9c7a8a5e1ee40fe7f9a80e488da7c045dd19
BLAKE2b-256 checksum
How to use checksums
c4ba62a9d64751bc267cb5e4a6d1da8b56bb277fa6a2586c5e9d92c9c41917e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release files / pipim-1.0.0-py3-none-any.whl

Download URL pipim-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d847c09353dfb23b62efb8d6aac91215bbbec0c02adad9a61790f04b7b3552d3
BLAKE2b-256 checksum
How to use checksums
cb7bf123ae9accf8e792d40eaac46ad5af2de035da9ab3ac23d893cf27897669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.7

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.0 This release

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