docs: prefer uvx over pipx in docs

This commit is contained in:
Xuehai Pan 2025-07-25 00:13:21 +08:00
parent 8a02ca5dc1
commit bc1b075d85
7 changed files with 34 additions and 32 deletions

View file

@ -11,8 +11,8 @@ body:
You may try the latest version of `nvitop` in an isolated environment with the following commands first:
```bash
pip3 install --upgrade pipx
PYTHONFAULTHANDLER=1 pipx run --spec git+https://github.com/XuehaiPan/nvitop.git nvitop
pip3 install --upgrade uv
PYTHONFAULTHANDLER=1 uvx --from git+https://github.com/XuehaiPan/nvitop.git nvitop
```
- type: checkboxes

View file

@ -11,8 +11,8 @@ body:
You may try the latest version of `nvitop` in an isolated environment with the following commands first:
```bash
pip3 install --upgrade pipx
PYTHONFAULTHANDLER=1 pipx run --spec git+https://github.com/XuehaiPan/nvitop.git nvitop
pip3 install --upgrade uv
PYTHONFAULTHANDLER=1 uvx --from git+https://github.com/XuehaiPan/nvitop.git nvitop
```
- type: checkboxes

View file

@ -11,8 +11,8 @@ body:
You may try the latest version of `nvitop` in an isolated environment with the following commands first:
```bash
pip3 install --upgrade pipx
PYTHONFAULTHANDLER=1 pipx run --spec git+https://github.com/XuehaiPan/nvitop.git nvitop
pip3 install --upgrade uv
PYTHONFAULTHANDLER=1 uvx --from git+https://github.com/XuehaiPan/nvitop.git nvitop
```
- type: checkboxes

View file

@ -146,34 +146,16 @@ Run `bash install-nvidia-driver.sh --help` for more information.
## Installation
**It is highly recommended to install `nvitop` in an isolated virtual environment.** Simple installation and run via [`pipx`](https://pypa.github.io/pipx) or [`uvx`](https://docs.astral.sh/uv/guides/tools) (a.k.a. `uv tool run`):
**It is highly recommended to install `nvitop` in an isolated virtual environment.** Simple installation and run via [`uvx`](https://docs.astral.sh/uv/guides/tools) (a.k.a. `uv tool run`) or [`pipx`](https://pypa.github.io/pipx):
```bash
pipx run nvitop
# or
uvx nvitop
# or
pipx run nvitop
```
You can also set this command as an alias in your shell startup file, e.g.:
```bash
# For Bash
echo 'alias nvitop="pipx run nvitop"' >> ~/.bashrc
# For Zsh
echo 'alias nvitop="pipx run nvitop"' >> ~/.zshrc
# For Fish
mkdir -p ~/.config/fish
echo 'alias nvitop="pipx run nvitop"' >> ~/.config/fish/config.fish
# For PowerShell
New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
'Function nvitop { pipx run nvitop @Args }' >> $PROFILE.CurrentUserAllHosts
```
or
```bash
# For Bash
echo 'alias nvitop="uvx nvitop"' >> ~/.bashrc
@ -190,6 +172,24 @@ New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType
'Function nvitop { uvx nvitop @Args }' >> $PROFILE.CurrentUserAllHosts
```
or
```bash
# For Bash
echo 'alias nvitop="pipx run nvitop"' >> ~/.bashrc
# For Zsh
echo 'alias nvitop="pipx run nvitop"' >> ~/.zshrc
# For Fish
mkdir -p ~/.config/fish
echo 'alias nvitop="pipx run nvitop"' >> ~/.config/fish/config.fish
# For PowerShell
New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
'Function nvitop { pipx run nvitop @Args }' >> $PROFILE.CurrentUserAllHosts
```
Install from PyPI ([![PyPI](https://img.shields.io/pypi/v/nvitop?label=pypi&logo=pypi)](https://pypi.org/project/nvitop)):
```bash

View file

@ -42,10 +42,12 @@ An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for G
Installation
""""""""""""
**It is highly recommended to install nvitop in an isolated virtual environment.** Simple installation and run via `pipx <https://pypa.github.io/pipx>`_:
**It is highly recommended to install nvitop in an isolated virtual environment.** Simple installation and run via `uvx <https://docs.astral.sh/uv/guides/tools>`_ (a.k.a. ``uv tool run``) or `pipx <https://pypa.github.io/pipx>`_:
.. code:: bash
uvx nvitop
# or
pipx run nvitop
Install from PyPI (|PyPI Package|_):

View file

@ -7,9 +7,9 @@ Prometheus exporter built on top of `nvitop`.
Start the exporter with the following command:
```bash
pipx run nvitop-exporter --bind-address 0.0.0.0 --port 5050
# or
uvx nvitop-exporter --bind-address 0.0.0.0 --port 5050
# or
pipx run nvitop-exporter --bind-address 0.0.0.0 --port 5050
```
Then you can access the metrics at [`http://localhost:5050/metrics`](http://localhost:5050/metrics).

View file

@ -413,8 +413,8 @@ def main() -> int:
or install `nvitop` in an isolated environment:
pip3 install --upgrade pipx
pipx run nvitop
pip3 install --upgrade uv
uvx nvitop
""",
).strip()
messages.append(f'{message}\n')