PhantomJS with Selenium error: Message: 'phantomjs' executable needs to be in PATH
<p>I am attempting to run this script:</p>

<p><a href="https://github.com/Chillee/coursera-dl-all" rel="noreferrer">https://github.com/Chillee/coursera-dl-all</a></p>

<p>However, the script fails at the line <code>session = webdriver.PhantomJS()</code> with the following error</p>

<pre><code>Traceback (most recent call last):
  File "dl_all.py", line 236, in &lt;module&gt;
    session = webdriver.PhantomJS()
  File "/home/&lt;user&gt;/.local/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 51, in __init__
    self.service.start()
  File "/home/&lt;user&gt;/.local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 69, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH. 

Exception AttributeError: "'Service' object has no attribute 'process'" in &lt;bound method Service.__del__ of &lt;selenium.webdriver.phantomjs.service.Service object at 0x7f6f632864d0&gt;&gt; ignored
</code></pre>

<p>How do I add phantomjs to my PATH? I am running ubuntu 16.04 and installed selenium via <code>npm install selenium</code>.</p>