xdpyinfo was not found, X start can not be checked! Please install xdpyinfo! and geckodriver' executable needs to be in PATH. errors when using selenium

I got these errors when using the Selenium example code which I found here (

W enabled features on your account that will make it possible to use headless Chrome. See here