目录
正常安装遇到的问题
当在控制台输入pip install selenium时候,遇到的问题如下:
主要爆红的问题为
解决办法和正确安装方法
降低selenium的版本即可
在vscode控制台输入上面的代码即可。
总结
正常安装遇到的问题
当在控制台输入pip install selenium时候,遇到的问题如下:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting selenium Using cached https://pypi.tuna.tsinghua.edu.cn/packages/10/56/8288d1813a68c1e0638515dbb777fce6d87d0d240e683216f956145310e6/selenium-4.11.2-py3-none-any.whl (7.2 MB) Requirement already satisfied: urllib3<3,>=1.26 in f:\anaconda\lib\site-packages (from urllib3[socks]<3,>=1.26->selenium) (2.0.7) Collecting trio~=0.17 (from selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dd/b61fa61b186d3267ef3903048fbee29132963ae762fb70b08d4a3cd6f7aa/trio-0.22.2-py3-none-any.whl (400 kB) Collecting trio-websocket~=0.9 (from selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/48/be/a9ae5f50cad5b6f85bd2574c2c923730098530096e170c1ce7452394d7aa/trio_websocket-0.11.1-py3-none-any.whl (17 kB) Collecting certifi>=2021.10.8 (from selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ba/06/a07f096c664aeb9f01624f858c3add0a4e913d6c96257acb4fce61e7de14/certifi-2024.2.2-py3-none-any.whl (163 kB) Collecting attrs>=20.1.0 (from trio~=0.17->selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl (60 kB) Requirement already satisfied: sortedcontainers in f:\anaconda\lib\site-packages (from trio~=0.17->selenium) (2.1.0) Requirement already satisfied: idna in f:\anaconda\lib\site-packages (from trio~=0.17->selenium) (2.8) Collecting outcome (from trio~=0.17->selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/55/8b/5ab7257531a5d830fc8000c476e63c935488d74609b50f9384a643ec0a62/outcome-1.3.0.post0-py2.py3-none-any.whl (10 kB) Requirement already satisfied: sniffio in f:\anaconda\lib\site-packages (from trio~=0.17->selenium) (1.3.1) Requirement already satisfied: cffi>=1.14 in f:\anaconda\lib\site-packages (from trio~=0.17->selenium) (1.15.1) Requirement already satisfied: exceptiongroup>=1.0.0rc9 in f:\anaconda\lib\site-packages (from trio~=0.17->selenium) (1.2.0) Collecting wsproto>=0.14 (from trio-websocket~=0.9->selenium) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/78/58/e860788190eba3bcce367f74d29c4675466ce8dddfba85f7827588416f01/wsproto-1.2.0-py3-none-any.whl (24 kB) Requirement already satisfied: pysocks!=1.5.7,<2.0,>=1.5.6 in f:\anaconda\lib\site-packages (from urllib3[socks]<3,>=1.26->selenium) (1.6.8) Requirement already satisfied: importlib-metadata in f:\anaconda\lib\site-packages (from attrs>=20.1.0->trio~=0.17->selenium) (6.7.0) Requirement already satisfied: pycparser in f:\anaconda\lib\site-packages (from cffi>=1.14->trio~=0.17->selenium) (2.19) Requirement already satisfied: h11<1,>=0.9.0 in f:\anaconda\lib\site-packages (from wsproto>=0.14->trio-websocket~=0.9->selenium) (0.14.0) Requirement already satisfied: typing-extensions in f:\anaconda\lib\site-packages (from h11<1,>=0.9.0->wsproto>=0.14->trio-websocket~=0.9->selenium) (4.7.1) Requirement already satisfied: zipp>=0.5 in f:\anaconda\lib\site-packages (from importlib-metadata->attrs>=20.1.0->trio~=0.17->selenium) (3.15.0) Installing collected packages: certifi, wsproto, attrs, outcome, trio, trio-websocket, selenium Attempting uninstall: certifi Found existing installation: certifi 2018.11.29 ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
主要爆红的问题为
ERROR: Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解决办法和正确安装方法
降低selenium的版本即可
pip install selenium==3.141.0
在vscode控制台输入上面的代码即可。
安装成功如下所示:
总结
安装 Selenium 环境就用下面的代码进行安装👇👇👇👇👇
pip install selenium==3.141.0