The error occurs because the compiler cannot find the png.h header file, which is required to build the iio package. You already have the header file at ~/rpm/x86_64/usr/include/libpng12/png.h, but the compiler is not looking in that directory.
You need to explicitly tell the compiler where to find the png.h header file by setting the CFLAGS environment variable to include the path to the directory containing png.h.
Set the CFLAGS environment variable to include the path to the directory containing png.h:
bashexport CFLAGS="-I~/rpm/x86_64/usr/include/libpng12"
Re-run the installation command:
bashuv pip install iio==29
If you want to make this change permanent, add the export line to your shell configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.profile):
bashecho 'export CFLAGS="-I~/rpm/x86_64/usr/include/libpng12"' >> ~/.bashrc source ~/.bashrc
Then retry the installation.
-I flag in CFLAGS tells the compiler to look in the specified directory for header files.CFLAGS, you ensure the compiler can find png.h during the build process.Vibe can make mistakes. Check answers. Learn more