Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

AttributeError: 'module' object has no attribute

Asked by Dhruv Tiwari Apr 20, 2021 2.3K views 1 answer
Share

About this question

I have two python modules:

a.py
import b 
def hello(): 
print "hello" 
print "a.py" 
print hello() 
print b.hi()
b.py
import a 
def hi(): 
print "hi"
When I run a.py, I get:
AttributeError: 'module' object has no attribute 'hi'
What does the error mean? How do I fix it?

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.