为什么我无法导入re模块?

2024-04-19 02:19:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我想导入re模块来进行一些网页抓取。
我写下了“import re”函数并得到了以下消息:

Traceback (most recent call last):
  File "/Users/willardsun/PycharmProjects/untitled/re.py", line 1, in <module><br>
    import re<br>
  File "/Users/willardsun/PycharmProjects/untitled/re.py", line 2, in <module><br>
    re.compile<br>
AttributeError: partially initialized module 're' has no attribute 'compile' (most likely due to a circular import)

这到底是什么意思?我检查了二元骨架,没有重模块。如果问题是由此引起的,那么如何重新安装模块?谢谢。你知道吗


Tags: 模块inpybrimportremostline