我试图安装和取消安装websockets模块,但是每当导入它时,都会引发错误。我该怎么做才能停止此错误?
我尝试从pip install websockets
和pip uninstall websockets
安装和取消安装websockets模块。
这是错误:
Traceback (most recent call last):
File "C:\Users\x\PycharmProjects\NewProject\RawDiscordBot\client.py", line 1, in <module>
import websockets
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\site-packages\websockets\__init__.py", line 3, in <module>
from .auth import *
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\site-packages\websockets\auth.py", line 12, in <module>
from .exceptions import InvalidHeader
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\site-packages\websockets\exceptions.py", line 294, in <module>
class AbortHandshake(InvalidHandshake):
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\site-packages\websockets\exceptions.py", line 305, in AbortHandshake
self, status: http.HTTPStatus, headers: HeadersLike, body: bytes = b""
AttributeError: module 'http' has no attribute 'HTTPStatus'
[Finished in 0.907s]
导入时应该没有错误