【坑】解决 AttributeError: 'NoneType' object has no attribute 'read_excel'

【坑】解决 AttributeError: 'NoneType' object has no attribute 'read_excel'
“D:/Program Files/IS-RPA2020/Studio-X64/../Python/pythons.exe” “C:/Users/li_d.neu/Desktop/CBqz/CBqz\codes\Main.py” -i e30=
2020-11-30 16:39:44,387 - C:/Users/li_d.neu/Desktop/CBqz/CBqz\codes\Main.py - Flow:forExcel1,StepNodeTag:161353475852,Note:
2020-11-30 16:39:44,403 - C:/Users/li_d.neu/Desktop/CBqz/CBqz\codes\Main.py - Flow:forExcel1,StepNodeTag:271040135774,Note:
Traceback (most recent call last):
File “C:/Users/li_d.neu/Desktop/CBqz/CBqz\codes\Main.py”, line 1795, in
pro.forExcel1()
File “C:/Users/li_d.neu/Desktop/CBqz/CBqz\codes\Main.py”, line 1516, in forExcel1
df = pd.read_excel(io=‘2020-11-15.xlsx’,sheet_name=1)
**AttributeError: ‘NoneType’ object has no attribute ‘read_excel’
** 运行异常

一个很简单的读取 excel 的组件,莫名其妙的报错。就是找不到原因,后来发现,是在子流程中定义了 pd 这样一个变量名,跟引入库的简称冲突了。所以大家在命名的时候一定要注意不要和关键字、引用重名