How to solve No module named ‘selenium’ in VS code?

We Are Going To Discuss About How to solve No module named ‘selenium’ in VS code?. So lets Start this Python Article.

How to solve No module named ‘selenium’ in VS code?

  1. How to solve How to solve No module named 'selenium' in VS code?

    Both answers above might work but it is better to create a virtual environment and install your dependencies in there. Since you're already using Anaconda, I'll list the steps below.
    You can create a virtual environment with Anaconda:
    conda create -n yourenvname python=x.x anaconda
    source activate yourenvname
    You can find more info how to setup your environment here

  2. How to solve No module named 'selenium' in VS code?

    Both answers above might work but it is better to create a virtual environment and install your dependencies in there. Since you're already using Anaconda, I'll list the steps below.
    You can create a virtual environment with Anaconda:
    conda create -n yourenvname python=x.x anaconda
    source activate yourenvname
    You can find more info how to setup your environment here

Solution 1

Both answers above might work but it is better to create a virtual environment and install your dependencies in there. Since you’re already using Anaconda, I’ll list the steps below.

You can create a virtual environment with Anaconda:

  1. conda create -n yourenvname python=x.x anaconda
  2. source activate yourenvname

You can find more info how to setup your environment here

Original Author William Of This Content

Solution 2

Please try python3 -m pip install selenium.
This will allow you to use the current active version of Python you are using.

Update:

I saw that you are using an .ipynb extension. I am not an expert in those kind of environments but I would try to run !python3 -m pip install selenium inside the file (not the terminal). This only the first time, then you can comment that line. Please try that.

Original Author programandoconro Of This Content

Solution 3

You’re might run a virtual environment and installed selenium in your default python environment. If so try to install it into the local one.

Original Author Huhngut Of This Content

Solution 4

Best Solution: Worked for me.

Issue: The version of python you are using does not have “Selenium” in its root folder. If you are using python 3.8 for instance, you are missing Selenium in “Lib\site-packages” directory.

  1. Go to your C:\ drive and locate all your Python folders (python version #s)
  2. In each folder go to “Lib\site-packages” and see if you have “Selenium” installed.
  3. If its in the folder of python version that you are not using, just copy the folders in the correct python version folder in “Lib\site-packages” path.

This should do it….

Original Author Jabir Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment