hello everyone

i created a python file DailyExpensessave.py

when i need to import this in another python program i was getting this error

> Traceback (most recent call last):
>    File "C:\Python32\DailyExpensessave", line 1, in <module>
>      from DailyExpenses import *
>  ImportError: No module named DailyExpenses 

Both the python files are in the same folder C:\Python32

yes @vegaseat @ihatehippies both the files in the same folder. checked the name its correct

no module named DailyExpenses, pretty much means what it says. Something is definately wrong with one of the script names/locations. You have DailyExpenses.py or .pyc in the same folder as DailyExpensessave.py ? Not in a subfolder or anything?

# shows a list of directories Python will scan (aka. PYTHONPATH)
# sys.path[0] will be this sript file's directory
import sys
print(sys.path)

Another option is to make a DailyExpenses.pth text file that contains the directory name where you can find the DailyExpenses.py file. You can save the path file in Python's "site-packages" directory.

This question has already been answered. Start a new discussion instead.