[GH-ISSUE #11] nvitop command not found after installation #10

Closed
opened 2026-05-05 03:21:40 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @monajalal on GitHub (Dec 16, 2021).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/11

I ran the same exact commands on Ubuntu 18.04 with no problem but it doesn't work in Ubuntu 20.04. Could you please have a look?

jalal@manu:/SeaExpNFS$ pip install --upgrade nvitop
Collecting nvitop
  Using cached https://files.pythonhosted.org/packages/66/01/ab487ca351609d1d3466846cdd20d9dbe647240ff04f0dae9812d29248ef/nvitop-0.5.2-py3-none-any.whl
Collecting cachetools>=1.0.1 (from nvitop)
  Using cached https://files.pythonhosted.org/packages/ea/c1/4740af52db75e6dbdd57fc7e9478439815bbac549c1c05881be27d19a17d/cachetools-4.2.4-py3-none-any.whl
Collecting nvidia-ml-py==11.450.51 (from nvitop)
Collecting termcolor>=1.0.0 (from nvitop)
Collecting psutil>=5.5.0 (from nvitop)
Installing collected packages: cachetools, nvidia-ml-py, termcolor, psutil, nvitop
Successfully installed cachetools-4.2.4 nvidia-ml-py-11.450.51 nvitop-0.5.2 psutil-5.8.0 termcolor-1.1.0
jalal@manu:/SeaExpNFS$ nvitop
nvitop: command not found
jalal@manu:/SeaExpNFS$ lsb_release -a
LSB Version:	core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic
jalal@manu:/SeaExpNFS$ uname -a
Linux manu 5.4.0-91-generic #102~18.04.1-Ubuntu SMP Thu Nov 11 14:46:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
jalal@manu:/SeaExpNFS$ python
Python 3.6.9 (default, Dec  8 2021, 21:08:43) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
jalal@manu:/SeaExpNFS$ pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Originally created by @monajalal on GitHub (Dec 16, 2021). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/11 I ran the same exact commands on Ubuntu 18.04 with no problem but it doesn't work in Ubuntu 20.04. Could you please have a look? ```console jalal@manu:/SeaExpNFS$ pip install --upgrade nvitop Collecting nvitop Using cached https://files.pythonhosted.org/packages/66/01/ab487ca351609d1d3466846cdd20d9dbe647240ff04f0dae9812d29248ef/nvitop-0.5.2-py3-none-any.whl Collecting cachetools>=1.0.1 (from nvitop) Using cached https://files.pythonhosted.org/packages/ea/c1/4740af52db75e6dbdd57fc7e9478439815bbac549c1c05881be27d19a17d/cachetools-4.2.4-py3-none-any.whl Collecting nvidia-ml-py==11.450.51 (from nvitop) Collecting termcolor>=1.0.0 (from nvitop) Collecting psutil>=5.5.0 (from nvitop) Installing collected packages: cachetools, nvidia-ml-py, termcolor, psutil, nvitop Successfully installed cachetools-4.2.4 nvidia-ml-py-11.450.51 nvitop-0.5.2 psutil-5.8.0 termcolor-1.1.0 jalal@manu:/SeaExpNFS$ nvitop nvitop: command not found ``` ```console jalal@manu:/SeaExpNFS$ lsb_release -a LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch Distributor ID: Ubuntu Description: Ubuntu 18.04.6 LTS Release: 18.04 Codename: bionic ``` ```console jalal@manu:/SeaExpNFS$ uname -a Linux manu 5.4.0-91-generic #102~18.04.1-Ubuntu SMP Thu Nov 11 14:46:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ``` ```console jalal@manu:/SeaExpNFS$ python Python 3.6.9 (default, Dec 8 2021, 21:08:43) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ``` ```console jalal@manu:/SeaExpNFS$ pip --version pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6) ```
gitea-mirror 2026-05-05 03:21:40 -06:00
Author
Owner

@XuehaiPan commented on GitHub (Dec 17, 2021):

@monajalal Seems nvitop does not present in your PATH. You may need to update your PATH environment variable. There is a similar issue #2 on Windows.

Solution 0:

Run nvitop with the full path:

$ ~/.local/bin/nvitop

Solution 1:

You can add the following line into your ~/.bash_profile (for bash) or ~/.zprofile (for zsh).

export PATH="${HOME}/.local/bin:${PATH}"

Then it will work in a new terminal window.

$ echo "${PATH}"
...:/home/jalal/.local/bin:...:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:...

$ nvitop
...

Solution 2:

Since nvitop does not show up in your PATH, you can run python -m <module name> with the Python executable that you run pip with.

/usr/bin/python3 -m nvitop

Solution 3 (sudo privilege required):

Install nvitop into /usr/local/bin for all user:

sudo /usr/bin/pip3 install nvitop

Since /usr/local/bin may always present in the PATH environment variable.


Explanation of why this problem occurs:

jalal@manu:/SeaExpNFS$ pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

According to the above output, you are using the pip from system Python.

$ which -a pip
/usr/local/bin/pip
/usr/bin/pip
...

# System `pip` (`/usr/bin/pip3` or `/usr/bin/local/pip3`)
(sys) $ pip3 install nvitop        # installs to `~/.local/bin`
(sys) $ sudo pip3 install nvitop   # installs to `/usr/local/bin`

# `pip` in virtual environments (`venv` or `conda`)
(venv) $ pip3 install nvitop       # installs to `${PREFIX}/bin`

Run pip3 install nvitop (or pip3 install --user nvitop) with the system pip will install apps to a prefix in your home directory (~/.local/bin), and you need to add it to your PATH environment variable. Otherwise, you will need to use the full path ~/.local/bin/nvitop or run as a Python module python3 -m nvitop.

<!-- gh-comment-id:996386588 --> @XuehaiPan commented on GitHub (Dec 17, 2021): @monajalal Seems `nvitop` does not present in your `PATH`. You may need to update your `PATH` environment variable. There is a similar issue #2 on Windows. **Solution 0:** Run `nvitop` with the full path: ```console $ ~/.local/bin/nvitop ``` **Solution 1:** You can add the following line into your `~/.bash_profile` (for `bash`) or `~/.zprofile` (for `zsh`). ```bash export PATH="${HOME}/.local/bin:${PATH}" ``` Then it will work in a new terminal window. ```console $ echo "${PATH}" ...:/home/jalal/.local/bin:...:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:... $ nvitop ... ``` **Solution 2:** Since `nvitop` does not show up in your `PATH`, you can run `python -m <module name>` with the Python executable that you run `pip` with. ```bash /usr/bin/python3 -m nvitop ``` **Solution 3 (`sudo` privilege required):** Install `nvitop` into `/usr/local/bin` for all user: ```bash sudo /usr/bin/pip3 install nvitop ``` Since `/usr/local/bin` may always present in the `PATH` environment variable. ------ **Explanation of why this problem occurs:** > ```console > jalal@manu:/SeaExpNFS$ pip --version > pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6) > ``` According to the above output, you are using the `pip` from system Python. ```console $ which -a pip /usr/local/bin/pip /usr/bin/pip ... # System `pip` (`/usr/bin/pip3` or `/usr/bin/local/pip3`) (sys) $ pip3 install nvitop # installs to `~/.local/bin` (sys) $ sudo pip3 install nvitop # installs to `/usr/local/bin` # `pip` in virtual environments (`venv` or `conda`) (venv) $ pip3 install nvitop # installs to `${PREFIX}/bin` ``` Run `pip3 install nvitop` (or `pip3 install --user nvitop`) with the system `pip` will install apps to a prefix in your home directory (`~/.local/bin`), and you need to add it to your `PATH` environment variable. Otherwise, you will need to use the full path `~/.local/bin/nvitop` or run as a Python module `python3 -m nvitop`.
Author
Owner

@XuehaiPan commented on GitHub (Dec 17, 2021):

Feel free to reopen this issue if you have any other questions.

<!-- gh-comment-id:996387992 --> @XuehaiPan commented on GitHub (Dec 17, 2021): Feel free to reopen this issue if you have any other questions.
Author
Owner

@BitCalSaul commented on GitHub (Apr 26, 2024):

Hi I tried sudo /usr/bin/pip3 install nvitop and it was downloaded. But when i try sudo nvitop, the terminal said command not found. could you give any hints?

<!-- gh-comment-id:2079709799 --> @BitCalSaul commented on GitHub (Apr 26, 2024): Hi I tried sudo /usr/bin/pip3 install nvitop and it was downloaded. But when i try sudo nvitop, the terminal said command not found. could you give any hints?
Author
Owner

@BitCalSaul commented on GitHub (Apr 26, 2024):

image

I added nvitop path to the sudoer file, but it cames with error belowL
image

<!-- gh-comment-id:2079766944 --> @BitCalSaul commented on GitHub (Apr 26, 2024): <img width="1096" alt="image" src="https://github.com/XuehaiPan/nvitop/assets/142638691/eae55757-093f-458d-9cf6-caece2d48773"> I added nvitop path to the sudoer file, but it cames with error belowL <img width="463" alt="image" src="https://github.com/XuehaiPan/nvitop/assets/142638691/6c6482e3-a667-455c-9358-c32c7f0d35aa">
Author
Owner

@moluzhui commented on GitHub (Mar 6, 2025):

not found nvitop in ~/.local/bin

ls ~/.local/bin
ls: cannot access '/root/.local/bin': No such file or directory
<!-- gh-comment-id:2703006128 --> @moluzhui commented on GitHub (Mar 6, 2025): not found **nvitop** in `~/.local/bin` ``` ls ~/.local/bin ls: cannot access '/root/.local/bin': No such file or directory ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#10
No description provided.