uv init is not the first run

uv init only writes files. The command that actually runs the entrypoint is uv run.

uv init writes pyproject.toml. It does not run the entrypoint. The first command that actually executes the script is uv run hello-world. To line up that command list, open a room on oakmeet.

The searchable mistake is treating uv init as the first run. The official projects guide tries uv run hello-world and prints Hello from hello-world!. .venv and uv.lock appear after the first project command, not at init.

uv inituv adduv run
uv runFirst command that runs the app
.venvCreated on the first project command
0No manual activate before uv run

init writes files; run executes

What uv init creates

uv init hello-world then cd, or mkdir and uv init in place. Official tree: .git/, .gitignore, .python-version, pyproject.toml, README.md, src/hello_world/__init__.py.

uv run is the first real run

The same page says try the entrypoint with uv run hello-world. .venv/ and uv.lock appear on the first uv run, uv sync, or uv lock. A toml file is not a running process.

Jobuvpip / venv
Project metadatauv init → pyproject.tomlHand-written or a template, often with requirements.txt
Dependenciesuv add requests (toml, lock, env)pip install after activate
First entrypoint runuv run hello-worldsource .venv/bin/activate then python

Three commands through the first run

  1. 01
    Install uv

    macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh. Windows: irm https://astral.sh/uv/install.ps1 | iex. Or brew install uv / pipx install uv. uv should print help.

  2. 02
    uv init, then uv add

    uv init hello-world then cd hello-world. Need a library? uv add requests. From an old file: uv add -r requirements.txt. That still does not run the entrypoint.

  3. 03
    The first command that runs the project

    Run uv run hello-world. The docs print Hello from hello-world!. For a script: uv run example.py. Each run syncs lock and env. Extra packages are not pruned by default.

  4. 04
    source only on the old activate path

    Fallback in the same guide: uv sync, then source .venv/bin/activate (PowerShell: .venv\Scripts\activate), then python or flask run. Skip activate and you cannot drop uv run. Prefer run on a new repo.

curl -LsSf https://astral.sh/uv/install.sh | sh
uv init hello-world
cd hello-world
uv add requests
uv run hello-world

Seeing pyproject is not a run. uv run is the first cut.

Why there is no .venv yet
init does not create the project environment. Official: the first uv run / uv sync / uv lock creates .venv and uv.lock.
If you already think in pip
You can uv sync, activate, then python. That is the fallback. A new repo can stay on uv run.
Are extra packages removed
Official: uv run does not remove packages absent from the lockfile by default. One run is not a full prune.

Put the commands on one page

If two people need to agree which command counts as “it runs,” draw init / add / run on one board. oakmeet is a browser whiteboard with a space code and no signup. It is not a Python package manager.

Align, then run the repo on your own machines. Next: start a room, or see create and join a space and features.

Why isn’t hello-world a system command after uv init?

init only writes the [project.scripts] mapping. The documented trial is uv run hello-world. Until a project command creates the env, there is no .venv to activate.

Do I still need python -m venv?

No. uv creates .venv on the first project command. You only source it if you choose the sync-then-activate path and skip uv run.

How is uv add different from pip install?

Official: uv add edits pyproject.toml and updates the lockfile and project environment. pip install fills the currently activated env and does not maintain uv.lock for you.

Does oakmeet run uv for me?

No. oakmeet is a short-lived browser room and board. The start link is only so you can spread the command list for a colleague.

Start a room