The latest version of pycharm has changed a lot. When the new project is built, the default installation is not imported, which leads to many small partners paging.
Obviously PIP has installed selenium, but it has reported AttributeError:module’selenium.webdriver’has no attribute’Firefox’.
1.Run the following code and execute the error after execution
2.This code is very clear. Under the webdriver, aunt is red. If there is aunt red in this code, don’t run it. It must be wrong.
1.To check this problem, first determine that selenium has been installed, and do the following check in CMD.
> python >>> from selenium import webdriver
2.The above CMD confirmation is OK, that is, when the new pycharm project is out of order, when building a new project, pay attention to: first, open the area shown below.
3.Then select the following two frames
- Inherit global site-packages: Importing local packages
- Make available to all projects : Make all the items available
Note: this pit is mainly a new version of pycharm, which is built by default by venv.