Skip to content

error: command 'gcc-11' failed: No such file or directory #189

Open

Description

@dortamiguel

When I run sudo pip install evdev I get this error

WARNING: Ignoring invalid distribution ~heel (/home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/site-packages)
WARNING: Ignoring invalid distribution ~heel (/home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/site-packages)
Collecting evdev
  Using cached evdev-1.6.1.tar.gz (26 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: evdev
  Building wheel for evdev (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/util.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/uinput.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/genecodes.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/ff.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/evtest.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/events.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/eventio_async.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/eventio.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/ecodes.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/device.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/__init__.py -> build/lib.linux-x86_64-cpython-311/evdev
      running build_ext
      running build_ecodes
      writing /tmp/pip-install-95yix7gl/evdev_54da4839f83845318289710a6887a19b/evdev/ecodes.c (using /usr/include/linux/input.h /usr/include/linux/input-event-codes.h /usr/include/linux/uinput.h)
      building 'evdev._input' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/evdev
      gcc-11 -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/home/linuxbrew/.linuxbrew/opt/python@3.11/include/python3.11 -c evdev/input.c -o build/temp.linux-x86_64-cpython-311/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
      error: command 'gcc-11' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for evdev
  Running setup.py clean for evdev
Failed to build evdev
WARNING: Ignoring invalid distribution ~heel (/home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/site-packages)
Installing collected packages: evdev
  Running setup.py install for evdev ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for evdev did not run successfully.
  │ exit code: 1
  ╰─> [26 lines of output]
      running install
      /home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/util.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/uinput.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/genecodes.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/ff.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/evtest.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/events.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/eventio_async.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/eventio.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/ecodes.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/device.py -> build/lib.linux-x86_64-cpython-311/evdev
      copying evdev/__init__.py -> build/lib.linux-x86_64-cpython-311/evdev
      running build_ext
      ecodes.c already exists ... skipping build_ecodes
      building 'evdev._input' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/evdev
      gcc-11 -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/home/linuxbrew/.linuxbrew/opt/python@3.11/include/python3.11 -c evdev/input.c -o build/temp.linux-x86_64-cpython-311/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
      error: command 'gcc-11' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> evdev

I have gcc install but not gcc-11, is that the issue?

Activity

  1. aeghost commented on Mar 24, 2023

    @aeghost

    I resolved this using HomeBrew environment.

    After installing HomeBrew use
    brew install gcc@11

    Generally I prefer use HomeBrew to manage tools rather than dnf/pacman or apt.

    So my Distrib env is still unchanged, and my working tools are all localized in .linuxbrew user env.

  2. coder0xff commented on Jun 2, 2025

    @coder0xff

    @gvalkov Any chance of getting binary distributions in the Python package? I'd love for my users to not need to run sudo apt install build-essential python-dev and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions