title: Selenium on Python with Geckdriver crashes when not in headless mode
body: <p>I'm trying to use Selenium on a jupyter notebook with geckodriver.</p>
  <p>Although on headless mode it seems to work fine, I need to see the browser window since I'm learning...</p>
  <p>I've checked that both browser and driver are compatibles, driver it's added on the PATH variable and a few more tips I've seen around...</p>
  <p>This works fine:</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.firefox.options import Options
  
  options = Options()
  options.headless = True
  driver = webdriver.Firefox(options=options)
  driver.get(&quot;http://google.com/&quot;)
  print (&quot;Headless Firefox Initialized&quot;)
  driver.quit()
  </code></pre>
  <p>But when removing the headless option, it crashes:</p>
  <blockquote>
  <p>WebDriverException: Message: invalid argument: can't kill an exited process</p>
  </blockquote>
  <p>The only clue I can find its in the <strong>geckodriver.log</strong> where I can read:</p>
  <blockquote>
  <p>1596560987355  mozrunner::runner   INFO    Running command: &quot;/bin/firefox&quot; &quot;-marionette&quot; &quot;-foreground&quot; &quot;-no-remote&quot; &quot;-profile&quot; &quot;/tmp/rust_mozprofilejjh45q&quot;
  Error: no DISPLAY environment variable specified</p>
  </blockquote>
  <p>I've checked that that variable exists and it's like <strong>DISPLAY:0</strong>. I've also tried to change the value, to set it to my ip and port....</p>
  <p>This is driving me a bit mad so if anyone can give my hand it would be awesome!!
  Thanks in advance!!</p>
  <p>--&gt; Update: as @Wunderbread suggested, SeleniumBase works without problem.</p>
  <p>--&gt; Update: I was working Selenium on Jupiter Hub. Neither works on jupyter tree or PyCharm or VSC, but..... works perfect from a script on the terminal... life has mysteries.... xDD</p>