I have a module in a fibo.py
file which has the following functions -
#fibonacci numbers module
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print(b, end=' ')
a, b = b, a+b
print()
def fib2(n): # return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a+b
return result
Now when I run the module from the cli python3 as -
> python3 -m fibo.py
I get the error
Error while finding spec for 'fibo.py' (<class 'AttributeError'>:
'module' object has no attribute '__path__')
The __path__
variable has has the current dir . I am not sure how to fix this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…