Git Product home page Git Product logo

Comments (11)

XuehaiPan avatar XuehaiPan commented on August 16, 2024 1

I can reproduce this inside a CentOS 7 docker container.

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024

@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.

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024

@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

from nvitop.

yinrong avatar yinrong commented on August 16, 2024

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

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024

@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

from nvitop.

muzhi1991 avatar muzhi1991 commented on August 16, 2024

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

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024
$ 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

from nvitop.

muzhi1991 avatar muzhi1991 commented on August 16, 2024
  • 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.

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024

@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.

from nvitop.

muzhi1991 avatar muzhi1991 commented on August 16, 2024

it works! thank you!

from nvitop.

XuehaiPan avatar XuehaiPan commented on August 16, 2024

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

from nvitop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.