I having trouble installing PhantomJS to my project Following the suggestions from the similar question from so I defined the $PATH variable with executable path
$PATH
You need to give the path:
browser = webdriver.PhantomJS(executable_path='Complete path/to/phantomjs')
To find it use export PATH=${PATH:+$PATH:} in the command line as @Anderson commented.
export PATH=${PATH:+$PATH:}