0

When i attempt to import selenium i get the error:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import selenium
ModuleNotFoundError: No module named 'selenium'

My selenium module is currently in:

C:\Users\Maseeek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium

I've seen other people have it in a different directory and want to know how to fix it.

Haha
  • 973
  • 16
  • 43
  • Can you check which python version you are running? Maybe it's different from the one where selenium is installed, e.g. if you have multiple virtual environments – TC Arlen Aug 18 '21 at 21:19
  • Does this answer your question? [ImportError: No module named 'selenium'](https://stackoverflow.com/questions/31147660/importerror-no-module-named-selenium) – Prophet Aug 18 '21 at 21:19

2 Answers2

0

If you are using "PYCHARM" and if you created project with "Virtual Environment" you should choose "Python 3.x.x" instead of "Virtual Environment Python 3.9" that PyCharm created.

If you installed "anaconda" before you need to change paths of libaries.

0

If you're using PyCharm, then this might help:

PyCharm sometimes shows an error in importing modules that have already been installed (that's annoying). But, try to change the file location to this destination: C:\Users\Maseeek\PyCharm Projects\(project name)\venv\site-packages\ or try installing the package in PyCharm using python with the following code:

from sys import *
from subprocess import *
call(["-m", "pip", "install", "selenium"])
EasyWay Coder
  • 331
  • 1
  • 7