title: Selenium fails with error: Service geckodriver unexpectedly exited. Status code was: 2
body: <p>I am using</p>
  
  <ul>
  <li>Selenium 3.0.1 </li>
  <li>Python 2.7.12</li>
  <li>Firefox 50</li>
  </ul>
  
  <p>I have set the geckodriver's path in <code>PATH</code> but still I am getting the below error while running the test:</p>
  
  <blockquote>
    <p>selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 2</p>
  </blockquote>
  
  <p>Also, in <code>geckodriver.log</code> in my home directory below is displayed:</p>
  
  <blockquote>
  <pre><code>Usage:
      geckodriver [OPTIONS]
  geckodriver: Unknown option --port
  </code></pre>
  </blockquote>