I have Python 3.6 installed on my machine (Mac), and the Anaconda package as a whole. I am trying to run a simple script in PyCharm that looks like the following:
from selenium import webdriver
browser = webdriver.Firefox()
type(browser)
browser.get('http://inventwithpython.com')
When I run that I get the error message: 'Import error. No module named Selenium'.
EDIT: Here is the full stack trace that was requested below (Sorry, if this is not the full stack trace let me know):
Traceback (most recent call last): File "/Users/xxxx/PycharmProjects/StringsLoops/Selenium.py", line 1, in from selenium import webdriver ImportError: No module named 'selenium'
Process finished with exit code 1
I tried installing Selenium again using:
pip install selenium
and it installed successfully. I then ran my program again, same error. After some googling I tried:
python3 -m pip install selenium
That gave the following error:
'Requirement already satisfied: selenium in /Users/xxxx/anaconda/lib/python3.6/site-packages'
So I am lost at this point at what to do. I know a while back this used to work but that was before I:
A. upgraded OS to Mac OSX- Sierra
B. installed Anaconda (before I just had Python on my machine as a standalone and installed Selenium as a standalone)
Any ideas?
Thanks
python -c "from selenium import webdriver"and let me know what it says.