[GH-ISSUE #14] [Bug] Usage chart working in centos linux. #13

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

Originally created by @yinrong on GitHub (Mar 24, 2022).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/14

Originally assigned to: @XuehaiPan on GitHub.

not working in centos linux.

tested on:
CentOS Linux release 7.9.2009 (Core)

image

Originally created by @yinrong on GitHub (Mar 24, 2022). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/14 Originally assigned to: @XuehaiPan on GitHub. not working in centos linux. tested on: CentOS Linux release 7.9.2009 (Core) ![image](https://user-images.githubusercontent.com/4221569/159861472-7e46557d-8120-4ab4-ac08-3b3891165ff7.png)
gitea-mirror 2026-05-05 03:21:53 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@XuehaiPan commented on GitHub (Mar 24, 2022):

@yinrong Could you try to set LC_ALL before running nvitop? E.g.:

export LC_ALL='C.UTF-8'
nvitop

There is a similar issue #3.

And do you have libncursesw (with w suffix for wide char) installed on your machine? Have a quick check.

<!-- gh-comment-id:1077318544 --> @XuehaiPan commented on GitHub (Mar 24, 2022): @yinrong Could you try to set `LC_ALL` before running `nvitop`? E.g.: ```bash export LC_ALL='C.UTF-8' nvitop ``` There is a similar issue #3. And do you have `libncursesw` (with `w` suffix for wide char) installed on your machine? Have a quick check.
Author
Owner

@XuehaiPan commented on GitHub (Mar 25, 2022):

@yinrong Any updates? nvitop requires to set LC_ALL to UTF-8 with libncursesw installed. If you don't have the permission to install libncursesw, you can try:

nvitop -U
<!-- gh-comment-id:1078659780 --> @XuehaiPan commented on GitHub (Mar 25, 2022): @yinrong Any updates? `nvitop` requires to set `LC_ALL` to `UTF-8` with `libncursesw` installed. If you don't have the permission to install `libncursesw`, you can try: ```bash nvitop -U ```
Author
Owner

@yinrong commented on GitHub (Mar 29, 2022):

none above is working. I tried.

LC_ALL='C.UTF-8' nvitop -m
LC_ALL='C.UTF-8' nvitop -m -U
yum install ncurses-devel
LC_ALL='C.UTF-8' nvitop -m
LC_ALL='C.UTF-8' nvitop -m -U

@XuehaiPan

<!-- gh-comment-id:1081535801 --> @yinrong commented on GitHub (Mar 29, 2022): none above is working. I tried. ``` LC_ALL='C.UTF-8' nvitop -m LC_ALL='C.UTF-8' nvitop -m -U yum install ncurses-devel LC_ALL='C.UTF-8' nvitop -m LC_ALL='C.UTF-8' nvitop -m -U ``` @XuehaiPan
Author
Owner

@XuehaiPan commented on GitHub (Mar 29, 2022):

@yinrong nvitop -U only uses ASCII characters, that may work. Maybe your Python is not compiled with NCursesW library. Or you are using nvitop in a conda environment. But I'm not really sure.

Please provide more details of your runtime environment. Then we can investigate deeper.

  • Terminal emulator and version: [e.g. GNOME Terminal 3.36.2 / Windows Terminal 1.8.1521.0]
  • Python version: [e.g. 3.5.6 / 3.9.6]
head -1 "$(which nvitop)" | cut -b3-
PYTHON3="$(head -1 "$(which nvitop)" | cut -b3-)"
"${PYTHON3}" -V  # use the python executable you run `pip3 install nvitop` with

EDIT: detect Python interpreter from shebang.

  • Python compile options:
# use the python executable you run `pip3 install nvitop` with
"${PYTHON3}" -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]' | grep -i 'curses'
"${PYTHON3}" -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]'

Please paste the output with text in the comment below (not screenshot).

  • NCurses and NCursesW version and location:
locate libncursesw.so
  • nvitop version or commit: [e.g. 0.3.5.6 / main@b669fa3]
nvitop -V
  • Locale: [e.g. C / C.UTF-8 / en_US.UTF-8]
locale
<!-- gh-comment-id:1081606621 --> @XuehaiPan commented on GitHub (Mar 29, 2022): @yinrong `nvitop -U` only uses ASCII characters, that may work. Maybe your Python is not compiled with NCursesW library. Or you are using `nvitop` in a `conda` environment. But I'm not really sure. Please provide more details of your runtime environment. Then we can investigate deeper. - Terminal emulator and version: [e.g. GNOME Terminal 3.36.2 / Windows Terminal 1.8.1521.0] - Python version: [e.g. `3.5.6` / `3.9.6`] ```bash head -1 "$(which nvitop)" | cut -b3- PYTHON3="$(head -1 "$(which nvitop)" | cut -b3-)" "${PYTHON3}" -V # use the python executable you run `pip3 install nvitop` with ``` **EDIT:** detect Python interpreter from shebang. - Python compile options: ```bash # use the python executable you run `pip3 install nvitop` with "${PYTHON3}" -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]' | grep -i 'curses' "${PYTHON3}" -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]' ``` Please paste the output with text in the comment below (not screenshot). - NCurses and NCursesW version and location: ```bash locate libncursesw.so ``` - `nvitop` version or commit: [e.g. `0.3.5.6` / `main@b669fa3`] ```bash nvitop -V ``` - Locale: [e.g. `C` / `C.UTF-8` / `en_US.UTF-8`] ```bash locale ```
Author
Owner

@muzhi1991 commented on GitHub (Apr 18, 2022):

same problem

  • macos BigSur terminal:iterm2
  • Python 3.9.7
  • locate libncursesw.so
    /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so
    /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6
    /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6.3

python3 -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]' | grep -i 'curses'
HAVE_CURSES_FILTER 1
HAVE_CURSES_H 1
HAVE_CURSES_HAS_KEY 1
HAVE_CURSES_IMMEDOK 1
HAVE_CURSES_IS_PAD 1
HAVE_CURSES_IS_TERM_RESIZED 1
HAVE_CURSES_RESIZETERM 1
HAVE_CURSES_RESIZE_TERM 1
HAVE_CURSES_SYNCOK 1
HAVE_CURSES_TYPEAHEAD 1
HAVE_CURSES_USE_ENV 1
HAVE_CURSES_WCHGAT 1
HAVE_NCURSES_H 1
STRICT_SYSV_CURSES /* Don't use ncurses extensions */

  • nvitop version: 0.5.4
  • locale
    LANG=en_US.utf-8
    LC_CTYPE="en_US.utf-8"
    LC_NUMERIC="en_US.utf-8"
    LC_TIME="en_US.utf-8"
    LC_COLLATE="en_US.utf-8"
    LC_MONETARY="en_US.utf-8"
    LC_MESSAGES="en_US.utf-8"
    LC_PAPER="en_US.utf-8"
    LC_NAME="en_US.utf-8"
    LC_ADDRESS="en_US.utf-8"
    LC_TELEPHONE="en_US.utf-8"
    LC_MEASUREMENT="en_US.utf-8"
    LC_IDENTIFICATION="en_US.utf-8"
    LC_ALL=en_US.utf-8
<!-- gh-comment-id:1101134618 --> @muzhi1991 commented on GitHub (Apr 18, 2022): same problem * macos BigSur terminal:iterm2 * Python 3.9.7 * locate libncursesw.so /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6 /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6.3 python3 -c 'import sysconfig; [print(k, v) for k, v in sysconfig.get_config_vars().items()]' | grep -i 'curses' HAVE_CURSES_FILTER 1 HAVE_CURSES_H 1 HAVE_CURSES_HAS_KEY 1 HAVE_CURSES_IMMEDOK 1 HAVE_CURSES_IS_PAD 1 HAVE_CURSES_IS_TERM_RESIZED 1 HAVE_CURSES_RESIZETERM 1 HAVE_CURSES_RESIZE_TERM 1 HAVE_CURSES_SYNCOK 1 HAVE_CURSES_TYPEAHEAD 1 HAVE_CURSES_USE_ENV 1 HAVE_CURSES_WCHGAT 1 HAVE_NCURSES_H 1 STRICT_SYSV_CURSES /* Don't use ncurses extensions */ * nvitop version: 0.5.4 * locale LANG=en_US.utf-8 LC_CTYPE="en_US.utf-8" LC_NUMERIC="en_US.utf-8" LC_TIME="en_US.utf-8" LC_COLLATE="en_US.utf-8" LC_MONETARY="en_US.utf-8" LC_MESSAGES="en_US.utf-8" LC_PAPER="en_US.utf-8" LC_NAME="en_US.utf-8" LC_ADDRESS="en_US.utf-8" LC_TELEPHONE="en_US.utf-8" LC_MEASUREMENT="en_US.utf-8" LC_IDENTIFICATION="en_US.utf-8" LC_ALL=en_US.utf-8
Author
Owner

@XuehaiPan commented on GitHub (Apr 18, 2022):

$ locate libncursesw.so
/data/app/anaconda3/envs/faq-latest/lib/libncursesw.so
/data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6
/data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6.3

@muzhi1991 As we can see, you are using libncurses installed in conda environment rather than the system's one (under /usr/lib). What's the result for:

head -1 "$(which nvitop)"

Have you set the correct LD_LIBRARY_PATH? Try:

export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
nvitop

Alternatively, you can try:

/usr/bin/python3 -m pip install --user nvitop

and then run

~/.local/bin/nvitop
<!-- gh-comment-id:1101142335 --> @XuehaiPan commented on GitHub (Apr 18, 2022): > ```console > $ locate libncursesw.so > /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so > /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6 > /data/app/anaconda3/envs/faq-latest/lib/libncursesw.so.6.3 > ``` @muzhi1991 As we can see, you are using `libncurses` installed in conda environment rather than the system's one (under `/usr/lib`). What's the result for: ```bash head -1 "$(which nvitop)" ``` Have you set the correct `LD_LIBRARY_PATH`? Try: ```bash export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" nvitop ``` ------ Alternatively, you can try: ```bash /usr/bin/python3 -m pip install --user nvitop ``` and then run ``` ~/.local/bin/nvitop ```
Author
Owner

@muzhi1991 commented on GitHub (Apr 18, 2022):

  • head -1 "$(which nvitop)" outputs, use conda env python.
    #!/data/app/anaconda3/envs/faq-latest/bin/python

then
run LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" nvitop same result.

<!-- gh-comment-id:1101145041 --> @muzhi1991 commented on GitHub (Apr 18, 2022): * `head -1 "$(which nvitop)"` outputs, use conda env python. #!/data/app/anaconda3/envs/faq-latest/bin/python then run `LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" nvitop` same result.
Author
Owner

@XuehaiPan commented on GitHub (Apr 19, 2022):

I can reproduce this inside a CentOS 7 docker container.

<!-- gh-comment-id:1102139122 --> @XuehaiPan commented on GitHub (Apr 19, 2022): I can reproduce this inside a CentOS 7 docker container.
Author
Owner

@XuehaiPan commented on GitHub (Apr 19, 2022):

@yinrong @muzhi1991 I create a bug fix PR in #15. You try the fix with:

pip3 install git+https://github.com/XuehaiPan/nvitop.git@fix-locale-utf8#egg=nvitop

Let me know if it works for you.

<!-- gh-comment-id:1102225328 --> @XuehaiPan commented on GitHub (Apr 19, 2022): @yinrong @muzhi1991 I create a bug fix PR in #15. You try the fix with: ```bash pip3 install git+https://github.com/XuehaiPan/nvitop.git@fix-locale-utf8#egg=nvitop ``` Let me know if it works for you.
Author
Owner

@muzhi1991 commented on GitHub (Apr 19, 2022):

it works! thank you!

<!-- gh-comment-id:1102234320 --> @muzhi1991 commented on GitHub (Apr 19, 2022): it works! thank you!
Author
Owner

@XuehaiPan commented on GitHub (Apr 19, 2022):

Thanks for the feedback from @yinrong @muzhi1991! Now the fix is included in tag 0.5.5 and has been pushed to PyPI.

<!-- gh-comment-id:1102250801 --> @XuehaiPan commented on GitHub (Apr 19, 2022): Thanks for the feedback from @yinrong @muzhi1991! Now the fix is included in tag `0.5.5` and has been pushed to PyPI.
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#13
No description provided.