模块' a'没有属性func() [英] module 'a' has no attribute func()

查看:103
本文介绍了模块' a'没有属性func()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个模块:a:

    import another_module
    def func():

b:

    import a
    x=a.func()

这显示错误:模块'a'没有属性'func'.我在导入a.ipynb时做错了什么

This is showing error: module 'a' has no attribute 'func'. What i am doing wrong in importing a.ipynb

推荐答案

请确保您的模块名为"a.py",并且与b处于同一文件夹中,否则,请在所有其他模块所在的位置存储.

Make sure your module is names 'a.py', and it is in the same folder as b, otherwise, in the place where all the other modules are stored.

这篇关于模块' a'没有属性func()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆