HenryM
HenryM

Reputation: 5793

No module named webdriver

I've just installed Selenium (I'm that new to it) for Python using

sudo -H pip install selenium

and at the following command

from selenium.webdriver import Firefox 

I get

No module named webdriver

Any thoughts?

Upvotes: 2

Views: 5525

Answers (3)

MaciejTe
MaciejTe

Reputation: 36

Most probably your Python file is called

selenium.py

Python interpreter at first tries to import files from directory you're in, so the solution is to rename the executed file and issue will be gone.

Upvotes: 2

Arindam Roychowdhury
Arindam Roychowdhury

Reputation: 6511

Check if site packages link is added in system environment variables;

C:\Python27\Lib\site-packages;

On windows start, type environment variables. Click on the "Edit the system environment variables" . Click -> Environment variables -> Under System Variables-> Scroll down to find "Path" -> Edit and add above path.

Upvotes: 0

thebadguy
thebadguy

Reputation: 2140

first you need to import

from selenium import webdriver

then you can use other imports

Upvotes: -1

Related Questions