【经验分享||快速解决】VScode+Python配置Selenium环境配置问题。ERROR: Cannot uninstall ‘certifi‘.

目录

正常安装遇到的问题

[当在控制台输入pip install selenium时候,遇到的问题如下:](#当在控制台输入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的版本即可
bash 复制代码
pip install selenium==3.141.0
在vscode控制台输入上面的代码即可。

安装成功如下所示:

总结

安装 Selenium 环境就用下面的代码进行安装👇👇👇👇👇

bash 复制代码
pip install selenium==3.141.0
相关推荐
QxQ么么4 小时前
移远通信(桂林)26校招-助理AI算法工程师-面试纪录
人工智能·python·算法·面试
执笔论英雄4 小时前
Slime异步原理(单例设计模式)4
开发语言·python·设计模式
小徐敲java6 小时前
python使用s7协议与plc进行数据通讯(HslCommunication模拟)
开发语言·python
猫头虎6 小时前
如何解决 pip install 编译报错 fatal error: hdf5.h: No such file or directory(h5py)问题
人工智能·python·pycharm·开源·beautifulsoup·ai编程·pip
p***23366 小时前
python的sql解析库-sqlparse
数据库·python·sql
优爱蛋白6 小时前
B细胞细胞因子:免疫系统的“信使军团“与疾病治疗的新前沿
人工智能·经验分享·健康医疗
陈奕昆6 小时前
n8n实战营Day1课时3:高频节点解析+Webhook表单同步Excel实操
人工智能·python·n8n
深蓝电商API7 小时前
动态 Token、加密参数逆向全流程:从原理到实战破解
爬虫·python
qq_17082750 CNC注塑机数采7 小时前
【Python TensorFlow】 TCN-GRU时间序列卷积门控循环神经网络时序预测算法(附代码)
python·rnn·神经网络·机器学习·gru·tensorflow·tcn
java1234_小锋7 小时前
基于Python深度学习的车辆车牌识别系统(PyTorch2卷积神经网络CNN+OpenCV4实现)视频教程 - 切割车牌矩阵获取车牌字符
python·深度学习·cnn·车牌识别