1

I am trying to import Selenium to my Python code but it won't work.

I tried to install selenium in different ways. First, I installed it in cmd using "pip install selenium". Since importing of selenium didn't work I tried to install it using "pip3 install selenium" which wouldn't work either. I've tried to uninstall it a couple of times and reinstall, but none of my approaches seem to work. Pip even shows that selenium is installed on my system so I have no clue why Python won't let me import selenium.

The error message I get when I try to import selenium is the following:


ModuleNotFoundError Traceback (most recent call last) in () ----> 1 from selenium import webdriver

ModuleNotFoundError: No module named 'selenium'

I would very much appreciate if someone gave me any tips on how to proceed.

Thanks a lot!

Bastian

  • Okay so I tried to import selenium from cmd and it works fine. When I try to import it using Anaconda it doesn't. Does anyone know why it could be? – Bastian Grote Jun 08 '19 at 15:31
  • Anaconda probably has a private location for virtualenv where its own python installation and modules are installed. Try checking out the documentation at https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages – Naveen Jun 09 '19 at 17:43

0 Answers0