使用pycharm时from selenium import webdriver报错
使用pycharm时from selenium import webdriver报错,pycharm已经配置好,在IDLE里面代码没有问题。已经尝试过重装pycharm无法解决。报错信息如下:https://pan.baidu.com/s/1slqirxF Traceback (most recent call last):
File "D:/test1/select.py", line 1, in <module>
from selenium import webdriver
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\__init__.py", line 18, in <module>
from selenium import selenium
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\selenium.py", line 23, in <module>
import http.client as http_client
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 71, in <module>
import email.parser
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\email\feedparser.py", line 27, in <module>
from email._policybase import compat32
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\email\_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\email\utils.py", line 29, in <module>
import socket
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\socket.py", line 52, in <module>
import os, sys, io, selectors
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\selectors.py", line 11, in <module>
import select
File "D:\test1\select.py", line 1, in <module>
from selenium import webdriver
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\__init__.py", line 18, in <module>
from .firefox.webdriver import WebDriver as Firefox
File "C:\Users\123\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 20, in <module>
import http.client as http_client
AttributeError: module 'http' has no attribute 'client' import http.client as http_client
AttributeError: module 'http' has no attribute 'client'
是这句报错才对,http模块下没有client属性,你应该都不能点出来的,所以http.client就是错的。
方便的话,你可以贴一下代码。
页:
[1]