####1. First, you need to know the current selenium directory
create a new Python file as follows:
import selenium
print selenium.__file__
The printed file path is
C:\Python27\lib\site-packages\selenium\__init__.pyc
####2. Find the folder and file with the same name. There is a file named selenium in the current directory. Python will import this file first, and then import selenium.py in the standard library. In case of this problem, there may be more than one directory selenium with the same name or the file name selenium.py. Through the folder to find duplicate folder or file, it can be deleted or renamed
Only one selenium folder and one selenium.py file are allowed
Now you can execute from selenium import webdriver
. If there is no problem, the problem has been solved
####3. If the problem can’t be solved, you can reload selenium
Similar Posts:
- Error reporting in Firefox using selenium in Python
- Message: ‘geckodriver’ executable needs to be in PATH. [Solved]
- Under Ubuntu system, selenium opens the Firefox browser and prompts’ unable to find a matching set of capabilities. And message: connect
- How to Solve centos7 selenium–unknown error: DevToolsActivePort file doesn’t exist
- [Solved] Error in Python selenium + phantom JS alert() pop-up window
- seleniumImportError No module named selenium
- Mac environment and python + selenium environment are built to solve the error reporting problem of chromedriver
- selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
- [Solved] ImportError: cannot import name pywrap_tensorflow
- [Solved] SQLAlchemy Error: ImportError: cannot import name ‘TYPE_CHECKING’