Tengo un entorno virtual creado con virtualenv con la versión de python 3.9 donde estoy haciendo pruebas de desarrollo; sin embargo, el resultado que obtengo es el siguiente:
**❯ pip install pynput
Collecting pynput
Using cached pynput-1.7.6-py2.py3-none-any.whl (89 kB)
Collecting python-xlib>=0.17
Using cached python_xlib-0.33-py2.py3-none-any.whl (182 kB)
Collecting evdev>=1.3
Using cached evdev-1.6.0.tar.gz (26 kB)
Preparing metadata (setup.py) ... done
Collecting six
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
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
╰─> [69 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/evdev
copying evdev/events.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/genecodes.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/ecodes.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/uinput.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/eventio_async.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/evtest.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/__init__.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/ff.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/eventio.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/device.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/util.py -> build/lib.linux-x86_64-cpython-39/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)
/bin/sh: 1: /home/cesar_chavez/Documentos/Python/Entorno: not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-1no4xpgj/evdev_8e936150e2984745a1b81503b8e8e491/setup.py", line 151, in <module>
setup(**kw)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 325, in run
self.run_command("build")
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-install-1no4xpgj/evdev_8e936150e2984745a1b81503b8e8e491/setup.py", line 138, in run
self.run_command(cmd_name)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-install-1no4xpgj/evdev_8e936150e2984745a1b81503b8e8e491/setup.py", line 125, in run
create_ecodes(self.evdev_headers)
File "/tmp/pip-install-1no4xpgj/evdev_8e936150e2984745a1b81503b8e8e491/setup.py", line 106, in create_ecodes
check_call(cmd, cwd="%s/evdev" % here, shell=True)
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/bin/python genecodes.py /usr/include/linux/input.h /usr/include/linux/input-event-codes.h /usr/include/linux/uinput.h > ecodes.c' returned non-zero exit status 127.
[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
Installing collected packages: evdev, six, python-xlib, pynput
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
╰─> [30 lines of output]
running install
/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/lib/python3.9/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-39
creating build/lib.linux-x86_64-cpython-39/evdev
copying evdev/events.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/genecodes.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/ecodes.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/uinput.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/eventio_async.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/evtest.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/__init__.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/ff.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/eventio.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/device.py -> build/lib.linux-x86_64-cpython-39/evdev
copying evdev/util.py -> build/lib.linux-x86_64-cpython-39/evdev
running build_ext
ecodes.c already exists ... skipping build_ecodes
building 'evdev._input' extension
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/evdev
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC "-I/home/cesar_chavez/Documentos/Python/Entorno Virtual/wakeword/include" -I/usr/include/python3.9 -c evdev/input.c -o build/temp.linux-x86_64-cpython-39/evdev/input.o -std=c99 -Wno-error=declaration-after-statement
evdev/input.c:10:10: fatal error: Python.h: No existe el archivo o el directorio
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[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
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.**
Sé que es un tema de compilación por gcc debido a los archivos escritos en c++ pero tengo todas los paquetes necesarios, de hecho me apoyé en esta guía que comparto con ustedes por medio de este enlace. Todos los paquetes, wheel, pip setuptools están instalados y actualizados.
¿Alguien ha tenido un problema similar? Y de ser así, ¿cómo fue resuelto?
ecodes.c
no le sienta muy bien ese espacio que has puesto en el directorio de los entornos ("Entorno Virtual"
).