sezanzeb / input-remapper

🎮 ⌨ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.77k stars 155 forks source link

Error trying to install on Fedora 34 #181

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi,

sudo pip install git+https://github.com/sezanzeb/key-mapper.git
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting git+https://github.com/sezanzeb/key-mapper.git
  Cloning https://github.com/sezanzeb/key-mapper.git to /tmp/pip-req-build-qo10bki4
  Running command git clone -q https://github.com/sezanzeb/key-mapper.git /tmp/pip-req-build-qo10bki4
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (from key-mapper==1.0.0) (53.0.0)
Collecting evdev
  Using cached evdev-1.4.0.tar.gz (26 kB)
Requirement already satisfied: pydbus in /usr/local/lib/python3.9/site-packages (from key-mapper==1.0.0) (0.6.0)
Requirement already satisfied: pygobject in /usr/lib64/python3.9/site-packages (from key-mapper==1.0.0) (3.40.1)
Building wheels for collected packages: key-mapper, evdev
  Building wheel for key-mapper (setup.py) ... done
  Created wheel for key-mapper: filename=key_mapper-1.0.0-py3-none-any.whl size=130651 sha256=6e4a5865baf5255bb3086a1eda70e65d3f2f51b50b171ad43612c7b6908846d3
  Stored in directory: /tmp/pip-ephem-wheel-cache-k4jt_3e5/wheels/36/95/0a/bfefa836ed3bba5ca75362c8defaed75a76808e9811cce108c
  Building wheel for evdev (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"'; __file__='"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-r6g14g9d
       cwd: /tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/
  Complete output (29 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/evdev
  copying evdev/util.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/uinput.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/genecodes.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/ff.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/evtest.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/events.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/eventio_async.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/eventio.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/ecodes.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/device.py -> build/lib.linux-x86_64-3.9/evdev
  copying evdev/__init__.py -> build/lib.linux-x86_64-3.9/evdev
  running build_ext
  running build_ecodes
  writing 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-3.9
  creating build/temp.linux-x86_64-3.9/evdev
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-3.9/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
  evdev/input.c:10:10: fatal error: Python.h: Arquivo ou diretório inexistente
     10 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for evdev
  Running setup.py clean for evdev
Successfully built key-mapper
Failed to build evdev
Installing collected packages: evdev, key-mapper
    Running setup.py install for evdev ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"'; __file__='"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1vj1hz6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev
         cwd: /tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/
    Complete output (28 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/evdev
    copying evdev/util.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/uinput.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/genecodes.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/ff.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/evtest.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/events.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/eventio_async.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/eventio.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/ecodes.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/device.py -> build/lib.linux-x86_64-3.9/evdev
    copying evdev/__init__.py -> build/lib.linux-x86_64-3.9/evdev
    running build_ext
    ecodes.c already exists ... skipping build_ecodes
    building 'evdev._input' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/evdev
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-3.9/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
    evdev/input.c:10:10: fatal error: Python.h: Arquivo ou diretório inexistente
       10 | #include <Python.h>
          |          ^~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"'; __file__='"'"'/tmp/pip-install-daspia6t/evdev_733ef5c76aa84596a8f64e86546cda61/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1vj1hz6b/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev Check the logs for full command output.

When trying to install evdev via pip I get similar error. I consulted bug #171 but couldn't establish equivalence. Thanks in advance for any help.

sezanzeb commented 3 years ago

does sudo pip3 install evdev work? If it doesn't, then this belongs to https://github.com/gvalkov/python-evdev

I'm not an expert on compiling c, I won't be able to help there.

Someone should make an rpm package for key-mapper, but I don't have fedora and don't know how it can be done.

RistrettoMike commented 3 years ago

Came here with the same error, trying to install evdev directly as suggested returns an error on Fedora 34:

Collecting evdev Using cached evdev-1.4.0.tar.gz (26 kB) Using legacy 'setup.py install' for evdev, since package 'wheel' is not installed. Installing collected packages: evdev Running setup.py install for evdev ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"'; file='"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-d_vwjrlc/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev cwd: /tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/ Complete output (29 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/evdev copying evdev/util.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/uinput.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/genecodes.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/ff.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/evtest.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/events.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/eventio_async.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/eventio.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/ecodes.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/device.py -> build/lib.linux-x86_64-3.9/evdev copying evdev/init.py -> build/lib.linux-x86_64-3.9/evdev running build_ext running build_ecodes writing 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-3.9 creating build/temp.linux-x86_64-3.9/evdev gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-3.9/evdev/input.o -std=c99 -Wno-error=declaration-after-statement evdev/input.c:10:10: fatal error: Python.h: No such file or directory 10 | #include | ^~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1

ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"'; file='"'"'/tmp/pip-install-i8auqh88/evdev_b3aa8213981748079f7b6c18262805ec/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-d_vwjrlc/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/evdev Check the logs for full command output.

I've submitted an issue on the evdev page you linked. Cheers! ~M

Underknowledge commented 3 years ago

you two might need the package python3-devel you can check if it is installed with dnf history userinstalled | grep python

ghost commented 3 years ago

@Underknowledge: Thanks! Solved for me! And you @RistrettoMike ?

$ sudo pip install git+https://github.com/sezanzeb/key-mapper.git
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting git+https://github.com/sezanzeb/key-mapper.git
  Cloning https://github.com/sezanzeb/key-mapper.git to /tmp/pip-req-build-3pe89vqw
  Running command git clone -q https://github.com/sezanzeb/key-mapper.git /tmp/pip-req-build-3pe89vqw
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (from key-mapper==1.0.0) (53.0.0)
Collecting evdev
  Using cached evdev-1.4.0.tar.gz (26 kB)
Requirement already satisfied: pydbus in /usr/local/lib/python3.9/site-packages (from key-mapper==1.0.0) (0.6.0)
Requirement already satisfied: pygobject in /usr/lib64/python3.9/site-packages (from key-mapper==1.0.0) (3.40.1)
Building wheels for collected packages: key-mapper, evdev
  Building wheel for key-mapper (setup.py) ... done
  Created wheel for key-mapper: filename=key_mapper-1.0.0-py3-none-any.whl size=130682 sha256=d03e8a97d814b923ae2bb3124399dd80c6c8e3b2601fce6cc0bb31921bdcf100
  Stored in directory: /tmp/pip-ephem-wheel-cache-vye3ri0j/wheels/36/95/0a/bfefa836ed3bba5ca75362c8defaed75a76808e9811cce108c
  Building wheel for evdev (setup.py) ... done
  Created wheel for evdev: filename=evdev-1.4.0-cp39-cp39-linux_x86_64.whl size=84220 sha256=e470ae39c45e72793c97f8e2d7a409becab41388e54073cda4e2cc4946b97c74
  Stored in directory: /root/.cache/pip/wheels/b8/73/36/8c8d7ae588c7670bd787e7819b6ad1442d6f75b23e6912459c
Successfully built key-mapper evdev
Installing collected packages: evdev, key-mapper
Successfully installed evdev-1.4.0 key-mapper-1.0.0

But now there is a new problem... @RistrettoMike: do you also get this error?

$ sudo systemctl enable key-mapper
Failed to enable unit: Unit file key-mapper.service does not exist.
sezanzeb commented 3 years ago

try

sudo systemctl daemon-reload
sudo systemctl enable key-mapper
sudo systemctl start key-mapper
ghost commented 3 years ago

Not work...

$ sudo systemctl daemon-reload
$ sudo systemctl enable key-mapper
Failed to enable unit: Unit file key-mapper.service does not exist.

[Edit] Searching for "key-mapper"...

$ sudo find / -name *key-mapper*
/usr/local/lib/python3.9/site-packages/usr/lib/systemd/system/key-mapper.service
/usr/local/lib/python3.9/site-packages/usr/lib/udev/rules.d/key-mapper.rules
/usr/local/lib/python3.9/site-packages/usr/bin/key-mapper-control
/usr/local/lib/python3.9/site-packages/usr/bin/key-mapper-helper
/usr/local/lib/python3.9/site-packages/usr/bin/key-mapper-gtk
/usr/local/lib/python3.9/site-packages/usr/bin/key-mapper-service
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper-large.png
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/lang/it_IT/LC_MESSAGES/key-mapper.mo
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/lang/sk_SK/LC_MESSAGES/key-mapper.mo
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.glade
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.service
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.svg
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper-autoload.desktop
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.policy
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.rules
/usr/local/lib/python3.9/site-packages/usr/share/key-mapper/key-mapper.desktop
/usr/local/lib/python3.9/site-packages/usr/share/applications/key-mapper.desktop
/usr/local/lib/python3.9/site-packages/usr/share/polkit-1/actions/key-mapper.policy
/usr/local/lib/python3.9/site-packages/etc/xdg/autostart/key-mapper-autoload.desktop
sezanzeb commented 3 years ago

Yeah, I have seen that before, I don't know why some distributions decide to put that stuff into site-packages. Setup.py clearly has absolute paths in it: https://github.com/sezanzeb/key-mapper/blob/main/setup.py#L101

Until someone decides to make an .rpm package it will continue being that way for some fedora users.

sezanzeb commented 3 years ago

But you can try to use

sudo python3 setup.py install. It will be a pain to uninstall, but maybe that works

ghost commented 3 years ago

Did I do something wrong? Did I run setup.py in the right folder?

# cd /usr/local/lib/python3.9/site-packages/
# ls -l
drwxr-xr-x. 4 root   root   4096 set  6 01:15 etc
drwxr-xr-x. 6 root   root   4096 set  6 01:15 keymapper
drwxr-xr-x. 2 root   root   4096 set  6 01:15 key_mapper-1.0.0.dist-info
drwxr-xr-x. 3 root   root   4096 set  3 02:02 pydbus
drwxr-xr-x. 2 root   root   4096 set  3 02:02 pydbus-0.6.0.dist-info
-rw-r--r--. 1 user user 3623 set  6 14:54 setup.py
drwxr-xr-x. 5 root   root   4096 set  6 01:15 usr

# python3 setup.py install
running install
fatal: not a git repository (or any of the parent directories): .git
running build
running build_py
creating build
creating build/lib
creating build/lib/keymapper
copying keymapper/groups.py -> build/lib/keymapper
copying keymapper/mapping.py -> build/lib/keymapper
copying keymapper/utils.py -> build/lib/keymapper
copying keymapper/__init__.py -> build/lib/keymapper
copying keymapper/logger.py -> build/lib/keymapper
copying keymapper/data.py -> build/lib/keymapper
copying keymapper/key.py -> build/lib/keymapper
copying keymapper/config.py -> build/lib/keymapper
copying keymapper/state.py -> build/lib/keymapper
copying keymapper/presets.py -> build/lib/keymapper
copying keymapper/paths.py -> build/lib/keymapper
copying keymapper/user.py -> build/lib/keymapper
copying keymapper/daemon.py -> build/lib/keymapper
creating build/lib/keymapper/gui
copying keymapper/gui/reader.py -> build/lib/keymapper/gui
copying keymapper/gui/__init__.py -> build/lib/keymapper/gui
copying keymapper/gui/row.py -> build/lib/keymapper/gui
copying keymapper/gui/window.py -> build/lib/keymapper/gui
copying keymapper/gui/helper.py -> build/lib/keymapper/gui
creating build/lib/keymapper/ipc
copying keymapper/ipc/__init__.py -> build/lib/keymapper/ipc
copying keymapper/ipc/socket.py -> build/lib/keymapper/ipc
copying keymapper/ipc/pipe.py -> build/lib/keymapper/ipc
creating build/lib/keymapper/injection
copying keymapper/injection/macros.py -> build/lib/keymapper/injection
copying keymapper/injection/__init__.py -> build/lib/keymapper/injection
copying keymapper/injection/keycode_mapper.py -> build/lib/keymapper/injection
copying keymapper/injection/numlock.py -> build/lib/keymapper/injection
copying keymapper/injection/event_producer.py -> build/lib/keymapper/injection
copying keymapper/injection/injector.py -> build/lib/keymapper/injection
copying keymapper/injection/context.py -> build/lib/keymapper/injection
running egg_info
creating key_mapper.egg-info
writing key_mapper.egg-info/PKG-INFO
writing dependency_links to key_mapper.egg-info/dependency_links.txt
writing requirements to key_mapper.egg-info/requires.txt
writing top-level names to key_mapper.egg-info/top_level.txt
writing manifest file 'key_mapper.egg-info/SOURCES.txt'
reading manifest file 'key_mapper.egg-info/SOURCES.txt'
writing manifest file 'key_mapper.egg-info/SOURCES.txt'
running install_lib
running install_data
creating /usr/share/key-mapper
error: can't copy 'data/key-mapper.desktop': doesn't exist or not a regular file

# systemctl enable key-mapper
Failed to enable unit: Unit file key-mapper.service does not exist.

# cd /usr/share/key-mapper/
# ls -l
total 0
sezanzeb commented 3 years ago

You should run sudo python3 setup.py install in the folder cloned from git

sezanzeb commented 3 years ago

you could also try sudo pip install --no-binary :all: git+https://github.com/sezanzeb/key-mapper.git (https://stackoverflow.com/a/46087545)

RistrettoMike commented 3 years ago

Most recent thing I tried was manually cloning the git folder (which wouldn't actually occur using the sudo pip install git+https://github.com/sezanzeb/key-mapper.git command from the readme) then running the sudo python3 setup.py install command which returned this:

running install
generating translation for it_IT
generating translation for sk_SK
running build
running build_py
copying keymapper/commit_hash.py -> build/lib/keymapper
running egg_info
writing key_mapper.egg-info/PKG-INFO
writing dependency_links to key_mapper.egg-info/dependency_links.txt
writing requirements to key_mapper.egg-info/requires.txt
writing top-level names to key_mapper.egg-info/top_level.txt
reading manifest file 'key_mapper.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'key_mapper.egg-info/SOURCES.txt'
running install_lib
copying build/lib/keymapper/commit_hash.py -> /usr/local/lib/python3.9/site-packages/keymapper
byte-compiling /usr/local/lib/python3.9/site-packages/keymapper/commit_hash.py to commit_hash.cpython-39.pyc
running install_data
copying mo/it_IT/key-mapper.mo -> /usr/share/key-mapper/lang/it_IT/LC_MESSAGES
copying mo/sk_SK/key-mapper.mo -> /usr/share/key-mapper/lang/sk_SK/LC_MESSAGES
running install_egg_info
removing '/usr/local/lib/python3.9/site-packages/key_mapper-1.0.0-py3.9.egg-info' (and everything under it)
Copying key_mapper.egg-info to /usr/local/lib/python3.9/site-packages/key_mapper-1.0.0-py3.9.egg-info
running install_scripts

I then followed that up with the sudo systemctl enable key-mapper which returned:

Created symlink /etc/systemd/system/key-mapper.service → /usr/lib/systemd/system/key-mapper.service.
Created symlink /etc/systemd/system/default.target.wants/key-mapper.service → /usr/lib/systemd/system/key-mapper.service.

and finally sudo systemctl restart key-mapper which throws this error:

Job for key-mapper.service failed because the control process exited with error code.
See "systemctl status key-mapper.service" and "journalctl -xeu key-mapper.service" for details.

When reporting that error using the suggest systemctl command there it gives back this:

× key-mapper.service - Service to inject keycodes without the GUI application
     Loaded: loaded (/usr/lib/systemd/system/key-mapper.service; enabled; vendor preset: disab>
     Active: failed (Result: exit-code) since Tue 2021-09-07 08:19:30 EDT; 4min 20s ago
    Process: 25181 ExecStart=/usr/bin/key-mapper-service (code=exited, status=1/FAILURE)
   Main PID: 25181 (code=exited, status=1/FAILURE)
        CPU: 258ms

Sep 07 08:19:30 x270 key-mapper-service[25181]:   File "/usr/bin/key-mapper-service", line 48,>
Sep 07 08:19:30 x270 key-mapper-service[25181]:     from keymapper.daemon import Daemon
Sep 07 08:19:30 x270 key-mapper-service[25181]:   File "/usr/local/lib/python3.9/site-packages>
Sep 07 08:19:30 x270 key-mapper-service[25181]:     from keymapper.injection.injector import I>
Sep 07 08:19:30 x270 key-mapper-service[25181]:   File "/usr/local/lib/python3.9/site-packages>
Sep 07 08:19:30 x270 key-mapper-service[25181]:     import evdev
Sep 07 08:19:30 x270 key-mapper-service[25181]: ModuleNotFoundError: No module named 'evdev'
Sep 07 08:19:30 x270 systemd[1]: key-mapper.service: Main process exited, code=exited, status=>
Sep 07 08:19:30 x270 systemd[1]: key-mapper.service: Failed with result 'exit-code'.
Sep 07 08:19:30 x270 systemd[1]: Failed to start Service to inject keycodes without the GUI ap>

So it looks like it's still an evdev error to me. I have yet to try your final command suggested above - so I'll try that next.

Cheers folks, ~M

Underknowledge commented 3 years ago

Also running fedora 34 and I have to say, I had no problems installing it via sudo pip install git+https://github.com/sezanzeb/key-mapper.git Might be related to something I already had installed.

Current status of my system ```bash ~ ❯ cat /etc/redhat-release Fedora release 34 (Thirty Four) ~ ❯ dnf history userinstalled | grep -i "python\|evdev" python3-devel-3.9.6-2.fc34.x86_64 python3-packaging-20.9-1.fc34.noarch python3-pyparsing-2.4.7-5.fc34.noarch python3-qrcode-6.1-8.fc34.noarch python3-qrcode-core-6.1-8.fc34.noarch python3-virtualenv-20.4.0-2.fc34.noarch ``` ```bash ~ ❯ locate *key-mapper* /etc/systemd/system/key-mapper.service /etc/systemd/system/default.target.wants/key-mapper.service /etc/xdg/autostart/key-mapper-autoload.desktop /usr/bin/key-mapper-control /usr/bin/key-mapper-gtk /usr/bin/key-mapper-helper /usr/bin/key-mapper-service /usr/lib/systemd/system/key-mapper.service /usr/lib/udev/rules.d/key-mapper.rules /usr/share/key-mapper /usr/share/applications/key-mapper.desktop /usr/share/key-mapper/key-mapper-autoload.desktop /usr/share/key-mapper/key-mapper-large.png /usr/share/key-mapper/key-mapper.desktop /usr/share/key-mapper/key-mapper.glade /usr/share/key-mapper/key-mapper.policy /usr/share/key-mapper/key-mapper.rules /usr/share/key-mapper/key-mapper.service /usr/share/key-mapper/key-mapper.svg /usr/share/key-mapper/keymapper.Control.conf /usr/share/key-mapper/lang /usr/share/key-mapper/style.css /usr/share/key-mapper/lang/it_IT /usr/share/key-mapper/lang/sk_SK /usr/share/key-mapper/lang/it_IT/LC_MESSAGES /usr/share/key-mapper/lang/it_IT/LC_MESSAGES/key-mapper.mo /usr/share/key-mapper/lang/sk_SK/LC_MESSAGES /usr/share/key-mapper/lang/sk_SK/LC_MESSAGES/key-mapper.mo /usr/share/polkit-1/actions/key-mapper.policy /var/log/key-mapper ``` ```bash ~ ❯ pip -V pip 21.0.1 from /usr/lib/python3.9/site-packages/pip (python 3.9) ~ ❯ sudo pip list Package Version ------------------ ---------- appdirs 1.4.4 argcomplete 1.12.0 Beaker 1.10.0 beautifulsoup4 4.9.3 blivet 3.3.3 blivet-gui 2.3.0 Brlapi 0.8.2 cached-property 1.5.2 cffi 1.14.5 chardet 4.0.0 chrome-gnome-shell 0.0.0 click 7.1.2 colorama 0.4.4 cryptography 3.4.6 cupshelpers 1.0 dasbus 1.4 dbus-python 1.2.18 decorator 4.4.2 distlib 0.3.1 distro 1.5.0 evdev 1.4.0 fido2 0.9.1 filelock 3.0.12 fros 1.1 gpg 1.15.1 humanize 0.5.1 idna 2.10 iotop 0.6 key-mapper 1.0.0 langtable 0.0.56 libcomps 0.1.17 lxml 4.6.3 Mako 1.1.4.dev0 MarkupSafe 1.1.1 nftables 0.1 olefile 0.46 packaging 20.9 Paste 3.5.0 pexpect 4.8.0 pid 2.2.3 Pillow 8.1.2 pip 21.0.1 ply 3.11 powerline-status 2.8.2 productmd 1.33 psutil 5.8.0 ptyprocess 0.6.0 pwquality 1.4.4 pycairo 1.20.0 pycparser 2.20 pycrypto 2.6.1 pycups 2.0.1 pycurl 7.43.0.6 pydbus 0.6.0 pyenchant 3.2.1 pygit2 1.5.0 PyGObject 3.40.1 pykickstart 3.32 pyOpenSSL 20.0.1 pyparsing 2.4.7 pyparted 3.11.7 pyscard 1.9.7 pyserial 3.5 PySocks 1.7.1 python-augeas 0.5.0 python-dateutil 2.8.1 python-meh 0.50 pytz 2021.1 pyudev 0.22.0 pyxdg 0.27 qrcode 6.1 requests 2.25.1 requests-file 1.5.1 requests-ftp 0.3.1 rpm 4.16.1.3 selinux 3.2 sepolicy 3.2 setools 4.4.0 setuptools 53.0.0 simpleaudio 1.0.4 simpleline 1.8 six 1.15.0 slip 0.6.4 slip.dbus 0.6.4 sos 4.1 soupsieve 2.2 systemd-python 234 Tempita 0.5.1 termcolor 1.1.0 tldr 1.2.0 urllib3 1.25.10 virtualenv 20.4.0 youtube-dl 2021.6.6 yubikey-manager 4.0.5 ```
sezanzeb commented 3 years ago

@RistrettoMike

So it looks like it's still an evdev error to me. I have yet to try your final command suggested above - so I'll try that next.

Did you follow the advice here https://github.com/sezanzeb/key-mapper/issues/181#issuecomment-913223933 with the python3-devel package?

Afterwards I guess sudo pip3 install evdev should work

sezanzeb commented 3 years ago

There is also a python3-evdev package in fedora apparently: https://fedora.pkgs.org/34/fedora-x86_64/python3-evdev-1.1.2-10.fc34.x86_64.rpm.html, which should also work

RistrettoMike commented 3 years ago

@RistrettoMike

So it looks like it's still an evdev error to me. I have yet to try your final command suggested above - so I'll try that next.

Did you follow the advice here #181 (comment) with the python3-devel package?

Starting over & beginning with that python3-devel package before then following the regular readme solved the issue for me on Fedora 34. I have Key Mapper open now & am working on learning the syntax for mapping key combos :) Thanks folks!

Cheers,

~M

ghost commented 3 years ago

you could also try sudo pip install --no-binary :all: git+https://github.com/sezanzeb/key-mapper.git (https://stackoverflow.com/a/46087545)

$ sudo pip install --no-binary :all: git+https://github.com/sezanzeb/key-mapper.git
Collecting git+https://github.com/sezanzeb/key-mapper.git
  Cloning https://github.com/sezanzeb/key-mapper.git to /tmp/pip-req-build-kaou9v8q
  Running command git clone -q https://github.com/sezanzeb/key-mapper.git /tmp/pip-req-build-kaou9v8q
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (from key-mapper==1.0.0) (53.0.0)
Requirement already satisfied: evdev in /usr/local/lib64/python3.9/site-packages (from key-mapper==1.0.0) (1.4.0)
Requirement already satisfied: pydbus in /usr/local/lib/python3.9/site-packages (from key-mapper==1.0.0) (0.6.0)
Requirement already satisfied: pygobject in /usr/lib64/python3.9/site-packages (from key-mapper==1.0.0) (3.40.1)

$ sudo systemctl enable key-mapper
Failed to enable unit: Unit file key-mapper.service does not exist.

$ sudo pip list
Package            Version
------------------ ----------
...
key-mapper         1.0.0
...

$ sudo pip uninstall key-mapper
Found existing installation: key-mapper 1.0.0
Can't uninstall 'key-mapper'. No files were found to uninstall.
sezanzeb commented 3 years ago

@rafacure then try

git clone https://github.com/sezanzeb/key-mapper.git
cd key-mapper
sudo python3 setup.py install
sudo systemctl enable key-mapper

EDIT:

use

git clone https://github.com/sezanzeb/input-remapper.git
cd input-remapper
sudo python3 setup.py install
sudo systemctl enable input-remapper

beware that uninstalling is not easy with this method, since there is no package manager managing the files with setup.py install

ghost commented 3 years ago

@rafacure then try

git clone https://github.com/sezanzeb/key-mapper.git
cd key-mapper
sudo python3 setup.py install
sudo systemctl enable key-mapper

Solved! Thank you all!

RistrettoMike commented 3 years ago

Just wanted to confirm that on a fresh re-install of Fedora 34 I was able to install key-mapper first try by initially running sudo dnf install python3-devel followed by git clone https://github.com/sezanzeb/key-mapper.git sudo systemctl enable key-mapper sudo systemctl restart key-mapper

Seems like whatever Fedora didn't have built-in was solved with the python3-devel package. I just wanted to confirm for anyone who had the same issue still. Thanks again for the help & Cheers!

~M