from selenium import webdriver ImportError: No module named selenium" type="hidden"/>

python e.py Traceback (most recent call last): File "e.py", line 2, in from selenium import webdriver ImportError: No module named selenium


$python e.py 

Traceback (most recent call last):

  File "e.py", line 2, in <module>

    from selenium import webdriver

ImportError: No module named selenium

解决:安装selenium模块

$ python -m pip install -U selenium

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

Defaulting to user installation because normal site-packages is not writeable

Collecting selenium

  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)",)': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl

  Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)

     |████████████████████████████████| 904 kB 23 kB/s 

Requirement already satisfied, skipping upgrade: urllib3 in /Library/Python/2.7/site-packages (from selenium) (1.25.9)

Installing collected packages: selenium

Successfully installed selenium-3.141.0

结束。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 "> Selenium+Python调Chrome浏览器时报Traceback (most recent call last): File "C:/Users/EDZ/Desktop/selenium_demo/demo001.py", line 12, in from pip import main ImportError: cannot import name 'main'"> 执行sudo pip3 ...报错 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in from pip import main ImportError: cannot import name 'main' main()"> 安装pip报错Traceback (most recent call last): File "get-pip.py", line 22318, in main() execfile(join(CURDIR, 'src', 'SSHLibrary', 'version.py')) NameError: name 'execfile' is not defined"> Traceback (most recent call last): File "setup.py", line 22, in execfile(join(CURDIR, 'src', 'SSHLibrary', 'version.py')) NameError: name 'execfile' is not defined ", line 1, in NameError: name 'a' is not defined"> Thonny报错:Traceback (most recent call last): File "", line 1, in NameError: name 'a' is not defined PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable win10中通过Anaconda安装tensorflow时报错Traceback (most recent call last): File “E:\Anaconda3\lib\site-packages\pip_vendor\urllib3\response.py”, line 360, in _error_catcher yield 更新PIP报错 已解决:Traceback (most recent call last): File “d:\python3.6\lib\runpy.py“, "> WSL2解决Ubuntu的ccsm报错Could not connect: Connection refused Traceback (most recent call last): File "/usr/bin/ccsm", line 99, in python3 安装scrapy Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1006, in check_if_exists解决方法
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM