selenium包安装出错,出错提示如下,反正就是一大堆:
需要进入python文件夹下:
添加文件sitecustomize.py , 内容如下:
import sys
sys.setdefaultencoding('gb2312')
然后重启cmd, 再次运行pip install selenium, 即可成功!
后面运行程序会报错,记得将sitecustomize.py文件更名为:sitecustomize_back.py
而且需要注意,文件名不可命名为selenium.py!!!