I started to consider using uv for my project instead for pip. However, so far I am finding using it not as straightforward as I'd hoped.
EDIT: OS Windows 10, Python 3.10 installed from Windows Store.
pip install uv
in the new venv, because pip is used from the core python installation.mkdir uvtest
cd uvtest
python -m uv init
python -m uv venv
.venv\Scripts\activate
python -m uv help REM .venv\Scripts\python.exe: No module named uv
pip install uv REM Requirement already satisfied: uv in c:\users\sergz\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (0.5.13)```
A few things to note:
uv
to PATH.The workflow should thus look like this:
$ uv init uvtest && cd uvtest
Initialized project `uvtest` at `~\uvtest`
$ uv venv
Using CPython 3.13.0
Creating virtual environment at: .venv
Activate with: .venv\Scripts\activate
# https://docs.astral.sh/uv/concepts/projects/dependencies/
$ uv add some-dependency
Resolved 1 packages in 3.14ms
Prepared 1 package in 6.28ms
Installed 1 package in 2.72ms
+ some-dependency==1.2.3
# https://docs.astral.sh/uv/concepts/projects/run/
$ uv run some-tool --version
4.5.6
(uv venv
is actually unnecessary if you don't use an IDE that relies on virtual environments. Other commands like uv run
will create an environment if there isn't one already.)