Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: installed selenium package not detected

I am using the Anaconda python distribution and would like to use the selenium package. Unfortunately the distribution does not have selenium included in it so I installed it using the recommended:

pip install -U selenium

the distribution FAQ say this should work fine but when I try to use it I get python telling me it does not know anything about this package.

i.e.

>>> import selenium
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named selenium

I checked and the /usr/local/lib/python2.7/dist-packages directory does have selenium within it. How do I point my python distribution to this so I can use the package?

like image 277
G_T Avatar asked May 26 '15 05:05

G_T


People also ask

How do I add selenium to Python?

To install the Selenium bindings in our system, run the command: pip install selenium. As this is done, a folder called Selenium should get created within the Python folder. To update the existing version of Selenium, run the command: pip install –U selenium.

How do I fix No module named selenium error in Python 3?

The Python "ModuleNotFoundError: No module named 'selenium'" occurs when we forget to install the selenium module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install selenium command.


2 Answers

Following the advice of a comment in this question I installed Selenium using the pip installed with the distribution.

~/anaconda/bin/pip install -U selenium

I did not know about this before but it seems to have worked.

like image 82
G_T Avatar answered Oct 18 '22 08:10

G_T


Following works for me:

conda install -c conda-forge selenium

Please check the Selenium page in Anaconda website for details.

like image 25
Deqing Avatar answered Oct 18 '22 07:10

Deqing