报错
# 假设自定义模块file在folder文件夹中,import file模块中的function函数
from folder.file import function
如果在pycharm中新建一个Directory并在里面创建file.py文件会出现如下报错
Inspection info:This inspection detects names that should resolve but don’t. Due to dynamic dispatch and duck typing,this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.
解决方法
在pycharm中新建一个Python Package并在里面创建file.py文件
结语
如果您有修改意见或问题,欢迎留言或者通过邮箱和我联系。
如果我的文章对您有帮助,转载请注明出处。