首页 > 解决方案 > 导入错误:无法在 Anaconda 提示符下导入 numpy 和 pandas

问题描述

我已经安装了 numpy 1.16.4 和 pandas 0.24.2。但是我仍然收到以下错误消息;

Traceback (most recent call last):
File "C:\Users\FLUXNATURE\Desktop\khady_01\pandas.py", line 8, in'module'
import pandas as pd     
File "C:\Users\FLUXNATURE\Desktop\khady_01\pandas.py", line 9, in 'module'
df = pd.read_excel(r'C:\Users\FLUXNATURE\Desktop\use.xlsx')
AttributeError: module 'pandas' has no attribute 'read_excel'

运行以下代码时:

import pandas as pd

df = pd.read_excel(r'C:\Users\FLUXNATURE\Desktop\use.xlsx')
print(df)

我正在使用 Windows 在 Anaconda 提示符下运行此文件。请帮助解决这个问题。

标签: pythonpandasmoduleattributes

解决方案


推荐阅读