brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: python -m pip list --not-required shows only what you installed yourself

Python
~/tips/tip-python-pip-list-not-required

python3 -m pip list --not-required

Lists only the top-level packages in an environment, hiding the ones pulled in as dependencies.

A full pip list is mostly dependencies of dependencies. When I want to know what a project really asks for, I filter it down.

python3 -m pip list --not-required
python3 -m pip list --outdated

--not-required hides every package that another installed package depends on, so the list is close to your own requirements. --outdated adds the latest available version next to each package that has an update. Run both inside the virtual environment you care about, because pip only sees the environment of the interpreter you call. A top-level package that nothing needs and that you do not remember installing is a good candidate for removal.

Further reading: pip list reference

More Python tips import asyncio from enum import StrEnum, auto except* ValueError as eg: import pytest pytest --maxfail=2 All Python tips (107) All topics

Link