pip3 failed to install ueberzug in fedora 36

Viewed 424

I have tried to install ueberzug an image preview python tool but unfortunately it is giving this error someone please help me how to resolve this issue as i don't know weather it is operating system(Fedora 36) problem or python issue.

Here is the command run

pip install ueberzug

Here is the output for the above command

Defaulting to user installation because normal site-packages is not writeable
Collecting ueberzug
  Downloading ueberzug-18.1.9.tar.gz (36 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: python-xlib in /usr/local/lib/python3.10/site-packages (from ueberzug) (0.31)
Requirement already satisfied: pillow in /usr/lib64/python3.10/site-packages (from ueberzug) (9.1.0)
Requirement already satisfied: docopt in /usr/local/lib/python3.10/site-packages (from ueberzug) (0.6.2)
Requirement already satisfied: attrs>=18.2.0 in /usr/local/lib/python3.10/site-packages (from ueberzug) (21.4.0)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3.10/site-packages (from python-xlib->ueberzug) (1.16.0)
Using legacy 'setup.py install' for ueberzug, since package 'wheel' is not installed.
Installing collected packages: ueberzug
    Running setup.py install for ueberzug ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wsr8bot0/ueberzug_4bfe83741cb54dc5b20a8b59e18f636a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wsr8bot0/ueberzug_4bfe83741cb54dc5b20a8b59e18f636a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-izxqd76_/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vmr/.local/include/python3.10/ueberzug
         cwd: /tmp/pip-install-wsr8bot0/ueberzug_4bfe83741cb54dc5b20a8b59e18f636a/
    Complete output (53 lines):
    running install
    /usr/lib/python3.10/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-3.10
    creating build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/__init__.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/__main__.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/action.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/batch.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/conversion.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/files.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/geometry.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/layer.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/library.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/loading.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/parser.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/pattern.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/process.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/query_windows.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/scaling.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/terminal.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/thread.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/tmux_util.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/ui.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/version.py -> build/lib.linux-x86_64-3.10/ueberzug
    copying ueberzug/xutil.py -> build/lib.linux-x86_64-3.10/ueberzug
    creating build/lib.linux-x86_64-3.10/ueberzug/lib
    copying ueberzug/lib/__init__.py -> build/lib.linux-x86_64-3.10/ueberzug/lib
    creating build/lib.linux-x86_64-3.10/ueberzug/lib/v0
    copying ueberzug/lib/v0/__init__.py -> build/lib.linux-x86_64-3.10/ueberzug/lib/v0
    running egg_info
    writing ueberzug.egg-info/PKG-INFO
    writing dependency_links to ueberzug.egg-info/dependency_links.txt
    writing entry points to ueberzug.egg-info/entry_points.txt
    writing requirements to ueberzug.egg-info/requires.txt
    writing top-level names to ueberzug.egg-info/top_level.txt
    reading manifest file 'ueberzug.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'ueberzug.egg-info/SOURCES.txt'
    copying ueberzug/lib/lib.sh -> build/lib.linux-x86_64-3.10/ueberzug/lib
    running build_ext
    building 'Xshm' extension
    creating build/temp.linux-x86_64-3.10
    creating build/temp.linux-x86_64-3.10/Xshm
    gcc -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.10 -c Xshm/Xshm.c -o build/temp.linux-x86_64-3.10/Xshm/Xshm.o
    Xshm/Xshm.c:5:10: fatal error: X11/Xlib.h: No such file or directory
        5 | #include <X11/Xlib.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 io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wsr8bot0/ueberzug_4bfe83741cb54dc5b20a8b59e18f636a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wsr8bot0/ueberzug_4bfe83741cb54dc5b20a8b59e18f636a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-izxqd76_/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/vmr/.local/include/python3.10/ueberzug Check the logs for full command output.
3 Answers

Looks like the gcc compiler cant find the X11 header files on your system, make sure you have the dev library installed

sudo dnf install libX11-devel.x86_64

You may also need the X11 extensions

sudo dnf install libXext-devel libXxf86vm-devel

I think it has the same error like me when installed ueberzug.

Xshm/Xshm.c:5:10: fatal error: X11/Xlib.h: No such file or directory

You need to install JPEG libraries.

sudo dnf install libjpeg-dev zlib1g-dev python3-dev libxtst-dev

Apart from above solutions.. u might need to add

sudo dnf install make automake gcc gcc-c++ kernel-devel

this...

Related