Search code examples
python-3.xselenium-webdrivergeckodrivermacos-high-sierra

Troubleshooting installing Selenium WebDriver (macOS High Sierra)?


I am trying to use the Selenium WebDriver in a Python 3.5, macOS High Sierra, and Firefox environment. I have not succeeded in installing it. I hence have a question that is related (or even duplicates) questions such as this one here and this one here. Nontheless, I can't make it work.

Her is what I have done so far:

  1. I installed selenium via pip install selenium. pip freeze shows that I installed selenium==3.9.0
  2. I downloaded the gecko driver from https://github.com/mozilla/geckodriver/releases
  3. I unpacked the package and draged the driver to /usr/local/bin. I tried to put it into /usr/bin but I can't.
  4. I extanded $PATH. echo $PATH yields /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/Users/JohnDoe/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

When I run from selenium import webdriver I am thrown the following error

/Users/JohnDoe/anaconda/lib/python3.5/selenium/webdriver/__init__.py in <module> 
No module named 'selenium.webdriver.firefox.webdriver'

Can anybody help?

Edit: This question has been marked as a possible duplicate to the question asked here: Python : no module named selenium. However, I get the depicted error when running from selenium import webdriver, altough I followed all the steps described.


Solution

  • I solved the problem. Apparently, I had some depency issues. I uninstalled selenium, updaten anaconda, and reinstalled selenium again. Works like a charm now!