解决的问题AttributeError: partially initialized module ‘pandas’ has no attribute ‘read_json’ (most likely due to a circular import)
import pandas
df = pandas.read_json('Test/sites.json')
print(df.to_string())
在运行过程中遇到如下报错:
AttributeError: partially initialized module 'pandas' has no attribute 'read_json' (most likely due to a circular import)
解决方法:
检查其他模块的名称: 如果你有其他自定义模块或第三方模块的名称与pandas相似,可能会导致导入冲突。请确保没有其他模块干扰pandas的导入。如此处我命名该文件为json.py,即干扰了函数read_joson的使用。
其他函数如read_csv也适用。