NdagiStanley/py

★ 0Forks 0ShellGitHub ↗Compare

README

Python Best Practices

Steps

python -m venv .venv
source .venv/bin/activate

Thereafter use uv pip ...

Reason: uv venv creates an environment with clutter. To reproduce, run pip list in the newly created environment when using uv venv vs python -m venv .venv.

Alias to use: uvv instead of uv venv standing for python -m venv .venv; source .venv/bin/activate

Gotchas with uv

  • uv pip list doesn't list pip.
  • Sometimes, pip doesn't exist in a uv venv environment

Others

  • Issue raised in favour of uv pip list --not-required
  • pip-autoremove recursively removes a package and its unused dependencies. Latest version release date: 2021
  • pip-purge is an alternative for pip-autoremove. To run: chmod +x pip-purge then ./pip-purge X (X standing for the package name)

REF

Contributors

NdagiStanley

Issues