0

For the first time, I tried to use selenium. First, I installed selenium with the code "pip install selenium." Then, I checked that folder "selenium" was in the "C:\Users\tstak\Anaconda3\Lib\site-packages." However, selenium didn't work in IDLE (Python 3.7) with the code "from selenium import webdriver."

I downloaded selenium, and check where it is.

 from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> from selenium important webdriver
SyntaxError: invalid syntax
>>> from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> from selenium import webdriver
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'
>>> 
Al Imran
  • 882
  • 7
  • 29
  • 1
    Check if pip installed selenium module on some other Python version which is not being used by IDLE – Kamal Jan 24 '19 at 06:05
  • To check which python binary is running IDLE, enter `import sys; sys.executable` in the IDLE 3.7 Shell. Report the result here in a reply to me. (Start the reply with `@T` and click my name.) – Terry Jan Reedy Jan 24 '19 at 23:47
  • @T Thank you for your kind comment! This is the code which I have run.  >>> import sys; sys.executable 'C:\\Users\\tstak\\AppData\\Local\\Programs\\Python\\Python37\\pythonw.exe' – Takaharu Saito Jan 26 '19 at 03:33

1 Answers1

1

I believe Anaconda3 and the Python default IDLE draw their installed packages from different directories.

Also make sure you have the latest version of geckodriver installed as well otherwise it still might not work. Im new to python and had this issue as well but a there was a question on here that helped me with geckodriver.

How to use the gecko executable with Selenium

Ratchet
  • 41
  • 1
  • 1
  • 6
  • Thank you for your kind comment. I understand that original IDLE and Anaconda's Spyder have different directories. However, I don't understand how I match the directories... – Takaharu Saito Jan 26 '19 at 03:34