This page looks best with JavaScript enabled

Include compilation from Pip

 ·  🎃 kr0m

Some Pip packages assume that certain libraries will be found in specific paths without first checking if they are there. The installation of these packages will fail because it will not be able to locate the necessary files. To solve this problem, we will pass the correct path to Pip through global-options.

We try to install ueberzug using Pip:

pip install ueberzug

We will see the following error:

cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -I/usr/local/include/python3.7m -c Xshm/Xshm.c -o build/temp.freebsd-13.0-RELEASE-p1-amd64-3.7/Xshm/Xshm.o
Xshm/Xshm.c:5:10: fatal error: ‘X11/Xlib.h’ file not found
#include <X11/Xlib.h>
1 error generated.

To resolve them, we first locate the directory where the searched file is located:

locate Xlib.h


We run Pip again, but this time indicating an additional include:

pip install --global-option=build_ext --global-option="-I/usr/local/include/" ueberzug

If you liked the article, you can treat me to a RedBull here