python IDLE中import pandas提示错误
import pandas as pd如下
Traceback (most recent call last):
File "F:/pytest/003-1.py", line 1, in <module>
import pandas as pd
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\__init__.py", line 55, in <module>
from pandas.core.api import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\api.py", line 6, in <module>
from pandas.core.dtypes.dtypes import (
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\dtypes\dtypes.py", line 10, in <module>
from pandas._typing import Ordered
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\_typing.py", line 1, in <module>
from pathlib import Path
File "F:/pytest\pathlib.py", line 1, in <module>
from pathlib import Path
ImportError: cannot import name 'Path' from partially initialized module 'pathlib' (most likely due to a circular import) (F:/pytest\pathlib.py)
>>>
在定义文件名时,跟引用的库名重复
有没有? wuqramy 发表于 2020-5-8 22:27
在定义文件名时,跟引用的库名重复
有没有?
肯定没有 集结号 发表于 2020-5-8 22:40
肯定没有
我怀疑跟pandas有关,不知道是不是安装的问题,IDLE的问题 本帖最后由 永恒的蓝色梦想 于 2020-5-8 23:01 编辑
集结号 发表于 2020-5-8 22:40
肯定没有
还说没有?File "F:/pytest/003-1.py", line 1, in <module>
import pandas as pd
File "F:/pytest\pathlib.py", line 1, in <module>
from pathlib import Path你告诉我没有?
把你的pathlib文件名换成别的就解决了 集结号 发表于 2020-5-8 22:40
肯定没有
File "F:/pytest\pathlib.py", line 1, in <module>
from pathlib import Path 谢谢,确实是其他文件与库名相同了。
页:
[1]