0

I want to use selenium on Ubuntu with Python3. I run the following commands according to instructions:

ubuntu:~$ sudo pip-3.2 install -U selenium
Downloading/unpacking selenium
  Downloading selenium-2.37.2.tar.gz (2.6MB): 2.6MB downloaded
  Running setup.py egg_info for package selenium

Installing collected packages: selenium
  Running setup.py install for selenium

Successfully installed selenium
Cleaning up...

But when I try to import selenium module in python3 I get an error:

@ubuntu:~$ python3

    Python 3.2.5 (default, Sep  7 2013, 16:55:10) 
    [GCC 4.6.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import selenium
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named selenium
3
  • Did you restart the terminal? Commented Oct 27, 2013 at 17:13
  • Will it run with python 2.7? Commented Jan 28, 2014 at 2:57
  • In my case it works with python (python3 also does not work) Commented May 14, 2016 at 21:10

1 Answer 1

5

You can use selenium on Ubuntu with Python3 by following steps:

  1. use sudo apt-get install python3-pip to install pip for python3
  2. use sudo python3 -m pip install -U selenium to install selenium for python3
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.