ModuleNotFoundError: No module named selenium ( Solved)

ModuleNotFoundError_ No module named selenium

ModuleNotFoundError: No module named selenium error occurs if the selenium module is not properly installed or not configured properly. Selenium library provides features to automate the browser which has multiple use cases like automation testing, backend to virtual assistant, etc. Selenium comes with multi-programming language support like Java, Python, etc. In this article, we will specifically focus on solving the error No module named selenium with Python Interpreter.

ModuleNotFoundError: No module named selenium ( Solution ) –

The best solution is to install or reinstall selenium package to fix this error. But how?

Solution 1: Use pip to install selenium –

Use the below command to use pip for selenium installation.

pip install selenium
Modulenotfounderror no module named selenium
Modulenotfounderror no module named selenium

Optional Scenario :

1.1. In case the system needs admin privileges to run the above pip command for selenium installation. Then add sudo keyword at the beginning of the command for the Linux family OS. If you are using a Window-based OS, open the command prompt and run the above command only.

sudo pip install selenium

1.2  If you need to install any specific version for selenium all we need to mention in the same command.

pip install selenium==4.5.0

Regarding different versions of selenium with pip, refer selenium release notes on PyPI.

1.3 In case pip is outdated or failing then use the below command as a prerequisite before you run any of the above commands.

python -m ensurepip --default-pip
python -m pip install --upgrade pip setuptools wheel
pip install selenium

1.4 if the path is not set for pip itself then run the below command.

python -m pip install selenium

Solution 2: Use conda to install selenium –

Similar to pip we can use conda to install selenium with the below command.

conda install -c conda-forge selenium
no module named selenium using conda
no module named selenium using conda

Solution 3: Use source code to install selenium –

Installation for scratch. For this we need the download the source code. Since this source code is generic and has an implementation for multiple programming languages like java, python. Hence we need to first navigate into the Py folder and then build the wheel or any other binding format.

 

Thanks

DSL Team

 

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for signup. A Confirmation Email has been sent to your Email Address.

Something went wrong.

Meet Abhishek ( Chief Editor) , a data scientist with major expertise in NLP and Text Analytics. He has worked on various projects involving text data and have been able to achieve great results. He is currently manages Datasciencelearner.com, where he and his team share knowledge and help others learn more about data science.
 
Thank you For sharing.We appreciate your support. Don't Forget to LIKE and FOLLOW our SITE to keep UPDATED with Data Science Learner