I just started learning python and I'm having issues importing a module using the command line. So, I created a module and saved it as - Man_Data_PyDeck.py - and it here is the contained code in the module:
def fib_func(n):
total = 0
f1, f2 = 1, 2
while f1 < n:
if f1 % 2 ==0:
total = total +f1
f1, f2 = f2, f1 + f2
return(total)
if __name__ == "__main__":
limit = input("What is your chosen Max Fibonacci Number: ")
print(fib_func(int(limit)))
I can easily execute this module using the command line as follows:
python Man_Data_PyDeck.py
When I try import the module using the command line I receive an Import Error. The code I'm trying to import it with is as follows:
import Man_Data_PyDeck
The error I receive is:
>>> import Man_Data_PyDeck
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Man_Data_PyDeck'
Am I having path issues ? What is causing this?