I have been working on some a web scanning app including Selenium and Python 2.7 running on a Raspberry Pi. The app was working perfectly and then a stepped away for a few minutes and now it is not.
The problem seems to do with the Selenium imports and I have made no changes to those files. Here is what I am seeing:
Basic Python imports:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
That code consistently results in the following:
2016-04-29 17:01:23.428942
Traceback (most recent call last):
File "./testing.py", line 1, in <module>
from selenium import webdriver
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/__init__.py", line 18, in <module>
from .firefox.webdriver import WebDriver as Firefox
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 34, in <module>
from .remote_connection import FirefoxRemoteConnection
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/remote_connection.py", line 18, in <module>
from selenium.webdriver.remote.remote_connection import RemoteConnection
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_connection.py", line 34, in <module>
from . import utils
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/utils.py", line 26, in <module>
LOGGER = logging.getLogger(__name__)
AttributeError: 'module' object has no attribute 'getLogger'
Again, to be clear these imports were working perfectly before and I have made no changes. It feels like there is something bigger going on and I would love any perspectives or troubleshooting tips.
Thank you!
test.pyand pip installedseleniumruns like a charm.import loggingforLOGGER = logging.getLogger(__name__)?logging.getLogger(__name__)refers to Python's logging facility (docs.python.org/2/howto/logging.html), and I always thought you have to import it to use. So error itself is about missing import inutils.py(I think), but the reason you are getting it might be that selenium wants to report some actual error. In which case your theory may be right