最佳答案
将文件名 abc.py
更改为其他名称,例如 testo.py
,它将起作用。
from google.colab import files
upload = files.upload()
用!ls检查
testo.py
尝试:
import testo
testo.myfunction()
世界你好!
说明:abc
是内置模块,您不应在模块中使用该名称。检查这个问题了解更多info .
关于python - 导入错误: cannot import name 'my_function' from 'abc' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66486992/