Importing PYC

Steve Holden sholden at holdenweb.com
Wed Mar 27 12:05:20 EST 2002


"Franck Abella" <fabella at free.fr> wrote ...
> Hi,
>
> I download  a pyc libray and i have a problem to import it. The name of
the
> library is "LibDates.pyc" ( powerfull dates functions)  . I can't use
> "import LibDates.pyc" or "import LibDates" even if i put LibDates.pyc in
the
> python path library.
>
> How can i import it and use their functions ??
>
You don't say what error message you receive. One likely source of problems
is that the .pyc file format is dependent on the Python version, so you
cannot simply use a Python 1.5.2 .pyc with Python 2.1, for example. When the
source is available and the directory is writable, Python will silently
recompile modules whose .pyc files come from the wrong version. In your case
that can't happen because you have no source.

Hope this helps.

regards
 Steve







More information about the Python-list mailing list