trouble importing modules

B

Brandon Metcalf

I come from a Perl and C background and have been given an application
written in Python to maintain and I know very little about Python.
I'm having trouble at run time with importing modules. Specifically,
in several places time.strptime() is being used and Freeze is being
used to produce binaries for each platform where this application
runs. _strptime.py is also being supplied with the binaries.

The first problem I encountered coming from _strptime.py was:

ImportError: No module named calendar

_strptime.py imports calendar, but my thought was that since freeze
isn't being run against _strptime.py directly, the calendar module may
not be getting built into the resulting binary. So, I added "import
calendar" to the file I'm running freeze against. This fixed
(probably not in the proper way) the above error, but now I'm getting
from calendar.py:

ImportError: No module named datetime

So, my question is how can I ensure that all modules that
_strptime.py, calendar.py, etc. rely are built in the resulting
binaries without having to import everything explicitly in my code?

I'm using Python 2.3.4.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top