0

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

5
Contributors
6
Replies
8
Views
4 Years
Discussion Span
Last Post by sneekula
Featured Replies
  • Do you have a file named DailyExpenses.py in the same folder. It is case sensitive. Read More

  • 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? Read More

  • 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. Read More

0

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

1

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?

0
# 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)
1

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.
Please be thoughtful and detailed and be sure to adhere to our posting rules.