0

After extracting .tar.gz and running python setup install, selenium gets installed in,

....
creating /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Extracting selenium-3.4.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding selenium 3.4.3 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
.....

On running,

python functionalTest.py 

it works fine

But

python3.6 functionalTest.py

gives, error:

ModuleNotFoundError: No module named 'selenium'

because I could not install selenium using python3.6 on Ubuntu, successfully, as shown below,

$ ls setup*
setup.cfg  setup.py
$ python3.6 setup install
python3.6: can't open file 'setup': [Errno 2] No such file or directory
$ python3.6 setup.py install
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
.....
Original exception was:
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
$ 

Edit:

After installing setuptools, below is the observation,

$ python3.6 setup.py install
.....
creating /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Extracting selenium-3.4.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
selenium 3.4.3 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Processing dependencies for selenium==3.4.3
Finished processing dependencies for selenium==3.4.3
$ cd /usr/local/lib/python
python2.7/ python3.5/ python3.6/ 
$ 
$ easy_install --version
setuptools 20.7.0 from /usr/lib/python2.7/dist-packages (Python 2.7)
$ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$

Question:

How to configure for python3.6 to pick selenium? Why selenium is installed in /usr/local/lib/python2.7 despite using python3.6?

6
  • hi, run : python3.6 setup install to install selenium for python3.6 , then try running Commented Jun 30, 2017 at 20:52
  • Why not use pip? Commented Jun 30, 2017 at 20:54
  • @Stack On saying python3.6 setup.py install I get error, ModuleNotFoundError: No module named 'setuptools' from code from setuptools import setup Commented Jun 30, 2017 at 20:55
  • @AlexHall Does pip make sure that python3 & 2 pick selenium smoothly? Commented Jun 30, 2017 at 20:56
  • 1
    @overexchange , you can use pip , try pip3 install selenium or python3.6 -m pip install selenium , it should work Commented Jun 30, 2017 at 20:57

1 Answer 1

1

It looks like you have multiple versions of Python installed. Based on the logs that you've provided it appears that you have installed Selenium into your Python 2.7 install.

If you have changed Python 3 to run in your cmd with the command "python3.6" then you should run the setup by doing:

python3.6 setup install
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.