我的python文件(称为myLib.py)中有这个
def add(x, y):
return x + y
在我的jupeter笔记本中,我有以下代码:
import myLib as myLib
y=myLib.add(1,2)
print(y)
当我运行jupyter单元格时,出现以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-10-9b942a9ce18f> in <module>
1 import myLib as myLib
----> 2 y=myLib.add(1,2)
3 print(y)
AttributeError: module 'myLib' has no attribute 'add'
我正在使用VisualStudio
问题是什么?我如何解决
目前没有回答
相关问题 更多 >
编程相关推荐