We can easily fix the error importerror no module named selenium by just installing the selenium python package using pip, conda etc. There is so many python package managers like pip, conda which can install the selenium package in one line. The another way to install the selenium python package is direct from the source. In this article, We will explore those ways and fix the error.
Importerror no module named selenium: Solution –
Here will see the different ways of installing the selenium package. Because you will not get this error while running the code after successful installation of the python package.
Installation of selenium using pip –
This is the most popular way of installing selenium is a pip. Use the below command for installation
pip install selenium
This will down the package and install the same in the required path for you. There are a few things related to pip is –
1.1 – In some scenarios, It needs admin permission. Then you may add sudo with the above command.
sudo pip install selenium
1.2 – In Python 3, You may use the alternative command.
sudo pip3 install selenium
2 Installation of selenium using Conda –
Just like pip, Conda is also a trusted python package manager. Use the below command for installing selenium using conda .
conda install -c conda-forge selenium
Selenium is really useful for web scraping and test automation for web tools. Selenium is more popular with java and python. In fact, java has more market share than python with selenium. It actually automates the driver, which can be leveraged in many use cases.
If you are still stuck in the same issue, please refer to the official guide of selenium python for installation. Please go through it if you are a selenium python beginner. It will cover the example codes for basic understanding with various browser support.
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.