Coder Social home page Coder Social logo

Comments (2)

wookayin avatar wookayin commented on June 3, 2024

Thank you for the detailed report. It is that your system python is broken, in particular the curses standard library. You can also reproduce this with

$ python
>>> import curses

so this wouldn't be a problem of gpustat nor any other third-party packages.

I think it's because the minimal EC2 image does not have ncurses installed on the system. Most UNIX system should have ncurses installed by default, but the minimal AMI image does not.

Please try installing ncurses:

sudo apt-get update
sudo apt-get install -y libncurses5-dev libncursesw5-dev

See also https://bugs.python.org/issue43728

from gpustat.

Pagey avatar Pagey commented on June 3, 2024
ubuntu@..$ sudo apt-get update
Hit:1 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:4 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64  InRelease
Hit:5 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64  InRelease
Hit:6 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease
Get:7 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:8 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2611 kB]
Get:9 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.8 kB]
Get:10 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1067 kB]
Get:11 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [24.9 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2229 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [358 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.0 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1833 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [256 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [842 kB]
Get:18 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [18.4 kB]
Fetched 9605 kB in 2s (5386 kB/s)
Reading package lists... Done
ubuntu@..$ sudo apt-get install -y libncurses5-dev libncursesw5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libncurses-dev
Suggested packages:
  ncurses-doc
The following NEW packages will be installed:
  libncurses-dev libncurses5-dev libncursesw5-dev
0 upgraded, 3 newly installed, 0 to remove and 38 not upgraded.
Need to get 342 kB of archives.
After this operation, 2410 kB of additional disk space will be used.
Get:1 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses-dev amd64 6.2-0ubuntu2.1 [340 kB]
Get:2 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses5-dev amd64 6.2-0ubuntu2.1 [984 B]
Get:3 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libncursesw5-dev amd64 6.2-0ubuntu2.1 [988 B]
Fetched 342 kB in 0s (15.1 MB/s)
Selecting previously unselected package libncurses-dev:amd64.
(Reading database ... 147493 files and directories currently installed.)
Preparing to unpack .../libncurses-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libncurses5-dev:amd64.
Preparing to unpack .../libncurses5-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses5-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libncursesw5-dev:amd64.
Preparing to unpack .../libncursesw5-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncursesw5-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up libncursesw5-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up libncurses5-dev:amd64 (6.2-0ubuntu2.1) ...
Processing triggers for man-db (2.9.1-1) ...
ubuntu@..$
ubuntu@..$
ubuntu@..$ gpustat -i
Traceback (most recent call last):
  File "/opt/tensorflow/bin/gpustat", line 5, in <module>
    from gpustat import main
  File "/opt/tensorflow/lib/python3.10/site-packages/gpustat/__init__.py", line 16, in <module>
    from .core import GPUStat, GPUStatCollection
  File "/opt/tensorflow/lib/python3.10/site-packages/gpustat/core.py", line 31, in <module>
    from blessed import Terminal
  File "/opt/tensorflow/lib/python3.10/site-packages/blessed/__init__.py", line 14, in <module>
    from blessed.terminal import Terminal  # type: ignore
  File "/opt/tensorflow/lib/python3.10/site-packages/blessed/terminal.py", line 21, in <module>
    from .keyboard import (_time_left,
  File "/opt/tensorflow/lib/python3.10/site-packages/blessed/keyboard.py", line 19, in <module>
    import curses
  File "/usr/local/lib/python3.10/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
ubuntu@..$

from gpustat.

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.