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?
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.
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.
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.
Following works for me:
conda install -c conda-forge selenium
Please check the Selenium page in Anaconda website for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With