0

When I attempt to run my Selenium code on ubuntu, I am receiving the following error:

from selenium import webdriver Traceback (most recent call last): File "", line 1, in ImportError: No module named 'selenium'

Christine
  • 5,567
  • 2
  • 12
  • 35
Raj
  • 1
  • Can you clarify what your Selenium installation looks like? i.e., did you run 'pip install selenium' on the machine, etc? What setup steps for ubuntu did you follow? – Christine Nov 27 '19 at 16:38
  • i upgrade python2.7 to python 3.5. also install pip – Raj Nov 27 '19 at 16:46

2 Answers2

1

It's very simple. Following commands will done the job.

$ sudo apt-get install python-pip
$ sudo pip install selenium

If you still have problem then follow the documentation. You can also check related thread here.

Saif
  • 2,007
  • 2
  • 10
  • 25
  • The directory '/home/workland/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/workland/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. – Raj Nov 27 '19 at 17:08
1

Try this

Why You Getting This Error:

Well Python Says There is no selenium installed in python

If You Want To Use Selenium You Need To Download Install With Terminal:

Here is The Way You Can Try:

if Your pip3 is recognized Try This:

pip3 install selenium

if you get this error:

Command Not Found

Something Like That

Try This:

sudo apt-get install python-pip
sudo pip install selenium
Hamza Lachi
  • 926
  • 1
  • 24