1

I am new to Python. I created a new Python project using PyCharm. When I run my small standalone program, I am getting the following error.

"C:\D drive\Workspace\Python_scripts\MyFirstProj\venv\Scripts\python.exe"     "C:/D drive/Workspace/Python_scripts/MyFirstProj/searchproducts.py"
Traceback (most recent call last):
  File "C:/D drive/Workspace/Python_scripts/MyFirstProj/searchproducts.py", line 2, in <module> 
from selenium.webdriver.common.by import By
ModuleNotFoundError: No module named 'selenium.webdriver.common'

Process finished with exit code 1

I have installed PIP and installed Selenium through PIP.

I have Python, Python Scripts, Chrome driver path all in the environmental variables. Can someone help me understand why I am getting this error?

Nocturnal
  • 2,037
  • 2
  • 11
  • 14
  • 1
    Possible duplicate of [Python : no module named selenium](https://stackoverflow.com/questions/48267633/python-no-module-named-selenium) – undetected Selenium Apr 05 '18 at 15:30
  • @DebanjanB I checked the link and tried everything (Python installation, PIP installation, Selenium installation) mentioned in the post. In my case all three are installed properly. – Nocturnal Apr 05 '18 at 15:46

1 Answers1

1

PyCharm is using a VirtualEnviroment. You may have installed the libraries in a manual installation of python through PIP.

Read the documentation to install packages with PyCharm. https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

I think the documentation will help you.

Dragost11
  • 11
  • 2
  • Thank you! I installed Selenium through PyCharm's 'Project Interpreter' as mentioned in the document. This is fixed the issue! – Nocturnal Apr 05 '18 at 16:51