ModuleNotFoundError occurs when any specific package is not installed in the system. ModuleNotFoundError: No module named ‘webdriver_manager’ is such an error. In this post you will learn how to solve the ModuleNotFoundError: No module named ‘webdriver_manager’ error i n steps.
What is webdriver_manager?
The webdriver_manager is a Python library that helps in managing web drivers for Selenium. It simplifies the process of downloading and managing the web driver executables required for Selenium. It also provides a set of tools to automatically download and install the correct web driver based on the browser and its version.
Why ModuleNotFoundError: No module named ‘webdriver_manager’ Error comes?
The No module named ‘webdriver_manager’ error occurs because you are trying to import the webdriver_manager module in your Python code, but it does not exist in your Python environment.
You will get the error when you run the below lines of code.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
Output
ModuleNotFoundError: No module named 'webdriver_manager'
Solve No module named ‘webdriver_manager’
Below are the solutions to solve this error.
Solution 1: Check if webdriver_manager is installed:
- Open your command line or terminal.
- Enter the following command to check if the
webdriver_manager
the module is already installed. - If it shows you information about the module (such as the version and location), it means it is already installed. In that case, the error might be caused by a different issue.
pip show webdriver_manager
Solution 2: Install webdriver_manager
- If the
webdriver_manager
module is not installed, you need to install it using the pip package manager. Enter the following command in your command line or terminal. - Wait for the installation process to complete. Pip will download and install the
webdriver_manager
module along with any necessary dependencies.
pip install webdriver_manager
Solution 3: Verify the installation:
- After the installation is complete, you can check if the
webdriver_manager
the module is installed correctly by running the following command: - This command should display information about the module, such as the version and location. If it does not show any information or displays an error, there might have been an issue with the installation.
pip show webdriver_manager
Now after you run the same code that leads to the error then you will not get the modulenotfounderror.
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
Conclusion
The webdriver_manager allows you to manage web drivers for the selenium module. If you are getting the ModuleNotFoundError: No module named ‘webdriver_manager’ error then the above module will solve this error. In most cases, you will not get the error if you have installed the module.
Leave a Reply