I have problem with installing getch with pip

106 views Asked by At
C:\Users\matya>pip install getch
Collecting getch
  Using cached getch-1.0.tar.gz (1.3 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: getch
  Building wheel for getch (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      getchmodule.c
      getchmodule.c(2): fatal error C1083: Nejde otevýˇt soubor zahrnout: termios.h: No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for getch
  Running setup.py clean for getch
Failed to build getch
ERROR: Could not build wheels for getch, which is required to install pyproject.toml-based projects

C:\Users\matya>

hello im on windows 10 and i have this problem with installing getch can someone help me

1

There are 1 answers

1
AKX On

You're evidently on Windows, so you don't need to install the PyPI getch package.

You import the function from the msvcrt module:

from msvcrt import getch