If you are seeing the error "Error: Couldn't open display (null)" when trying to run a graphical program on a Linux or Unix system, it means that the system is unable to find an X server (the software that provides a graphical interface) to display the program's output.
This can be caused by a variety of factors, such as:
echo $DISPLAY
If the variable is not set, you can set it by running the following command:
export DISPLAY=:0
This will set the DISPLAY variable to the default value (display number 0).
Xorg
or X
. If it is not running, you can start it by running the following command:sudo service startx start