问题遇到的现象和发生背景
之前在解决一个报错的时候手贱改动了一些环境里面的.py文件,运行scrapy框架的时候,出现了如下报错,不知道该怎么解决了,是不是要重新再下载一次anaconda再安装呀
运行结果及报错内容
D:\Anaconda3\python.exe D:/个人文件/爬取.py
Traceback (most recent call last):
File "D:/个人文件/爬取.py", line 1, in <module>
from playwright.sync_api import Playwright, sync_playwright, expect
File "D:\Anaconda3\lib\site-packages\playwright\sync_api\__init__.py", line 25, in <module>
import playwright.sync_api._generated
File "D:\Anaconda3\lib\site-packages\playwright\sync_api\_generated.py", line 25, in <module>
from playwright._impl._accessibility import Accessibility as AccessibilityImpl
File "D:\Anaconda3\lib\site-packages\playwright\_impl\_accessibility.py", line 17, in <module>
from playwright._impl._connection import Channel
File "D:\Anaconda3\lib\site-packages\playwright\_impl\_connection.py", line 22, in <module>
from pyee import AsyncIOEventEmitter, EventEmitter
File "D:\Anaconda3\lib\site-packages\pyee\__init__.py", line 59, in <module>
from pyee._twisted import TwistedEventEmitter # noqa
File "D:\Anaconda3\lib\site-packages\pyee\_twisted.py", line 5, in <module>
from twisted.internet.defer import Deferred, ensureDeferred
File "D:\Anaconda3\lib\site-packages\twisted\internet\defer.py", line 46, in <module>
from twisted.python import lockfile
File "D:\Anaconda3\lib\site-packages\twisted\python\lockfile.py", line 42, in <module>
import pywintypes # type: ignore[import]
File "D:\Anaconda3\lib\site-packages\win32\lib\pywintypes.py", line 136, in <module>
__import_pywin32_system_module__("pywintypes", globals())
File "D:\Anaconda3\lib\site-packages\win32\lib\pywintypes.py", line 39, in __import_pywin32_system_module__
for suffix_item in imp.get_suffixes():
NameError: name 'imp' is not defined