|
|
Log in / Subscribe / Register

pip 26.1 released

Version 26.1 of the pip package installer for Python has been released. Richard Si has published a blog post that looks at some of the highlights of 26.1 including dependency cooldowns, experimental support for pylock (pylock.toml) files, and resolver improvements that will move pip closer to the goal of removing its legacy resolver. The release also includes several security fixes and drops support for Python 3.9.



to post comments

uv

Posted Apr 28, 2026 2:45 UTC (Tue) by champtar (subscriber, #128673) [Link] (4 responses)

I really recommend trying out uv, a simple 'uv run ...' makes sure you run in a venv with the right dependencies, it's blazing fast, has a shared cache, and can even manage python version.

uv is indeed great

Posted Apr 28, 2026 8:01 UTC (Tue) by cyperpunks (subscriber, #39406) [Link] (3 responses)

Indeed, and with inline script metadata, for example:
#! /usr/bin/python3

# /// script
# requires-python = ">=3.12"
# dependencies = [
#   "rich-argparse",
# ]
# ///

from rich_argparse import RichHelpFormatter
import sys
...
bash $ uv run myscript.py
Can also go one step further with a shebang trick and do:
bash$ cat myscript 
#! /usr/bin/env uv run myscript

# /// script
# requires-python = ">=3.12"
# dependencies = [
#   "rich-argparse",
# ]
# ///

from rich_argparse import RichHelpFormatter
import sys
...
bash$ chmod 0755 myscript
bash$ ./myscript

uv is indeed great

Posted Apr 28, 2026 14:14 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

> #! /usr/bin/env uv run myscript

How…does that work? Doesn't this execute `/usr/bin/env "uv run myscript"` or is there some magic going on (like `perl`?) where the shebang line is re-read and reparsed before actual execution…but `env` doesn't do that…does it?

uv is indeed great

Posted Apr 28, 2026 14:24 UTC (Tue) by geofft (subscriber, #59789) [Link]

The env trick is great but that isn't quite the syntax. It should be
#!/usr/bin/env -S uv run --script
You need env -S to split arguments on Linux (macOS's kernel splits at all spaces but Linux and most other UNIXes only split at the first space), you shouldn't pass the name of the script in the shebang, and you need --script both to allow you to leave off the .py extension and to make sure you are not loading the environment from a Python project that happens to contain your working directory.

uv has an example in the docs giving this shebang.

Note that this is a standardized feature and uv isn't the only tool that supports it. pipx, a sibling project to pip, also supports it, though uv is going to be a lot faster. (pip itself is just an installer, not a script runner. pip 26.0 does support installing into an existing environment by parsing this metadata with pip install --requirements-from-script, but for actually running, they consider this out of scope and suggest using pipx or uv.)

pipx

Posted Apr 29, 2026 17:44 UTC (Wed) by tamasrepus (subscriber, #33205) [Link]

FYI, inline script data parsing is not limited to uv. You can use pipx (which I prefer, since it's packaged in Debian and makes it easy to copy around these now "standalone" scripts to Debian systems):

#!/usr/bin/env -S pipx run --path

Implemented in: pypa/pipx issue #913


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds