0

So I am trying to use the selenium webdriver in a python script as follows:

from selenium import webdriver

Now this is all fine and dandy when I do it within the python shell, but if I write it into a script it tells me

Traceback (most recent call last):
  File "c:/Users/gvasquez/Scripts/viaUpdate.py", line 2, in <module>
    from Selenium import webdriver
ModuleNotFoundError: No module named 'selenium'.

Any thoughts? Thanks.

8
  • did you pip install Selenium? Try some of the troubleshooting steps from this post Commented Nov 26, 2019 at 18:38
  • 3
    from Selenium import webdriver Capitalization matters. Why are you using a capital S? Commented Nov 26, 2019 at 18:38
  • @JohnGordon this is good to point out. I grabbed the wrong traceback, as that was an error I had noticed when I first wrote the code. This is the current error with proper capitalization: Traceback (most recent call last): File "C:\Users\gvasquez\Scripts\viaUpdate.py", line 2, in <module> from selenium import webdriver ModuleNotFoundError: No module named 'selenium' Commented Nov 26, 2019 at 18:41
  • What command do you use to run the Python shell, and what command do you use to run the script? Commented Nov 26, 2019 at 18:42
  • @GrahamVasquez please update your question with the correct traceback Commented Nov 26, 2019 at 18:42

1 Answer 1

0

Alright so I feel really dumb, but it looks like all I had to do was run it with the python command prior to the filename:

PS C:\User\username\scripts> python viaUpdate.py

instead of PS C:\User\username\scripts> viaUpdate.py

Thanks for the help.

Sign up to request clarification or add additional context in comments.

Comments