'import site' failed; use -v for traceback

Fredrik Lundh effbot at telia.com
Thu Feb 10 09:09:23 CET 2000


Warren Postma <embed at geocities.com> wrote:
> I have just built a static version of the python interpreter, and linked
it
> to the sample code from "Demo\embed" subdirectory, and it runs, but the
> first line it prints out is:
>
> 'import site' failed; use -v for traceback
>
> I figured out that I needed a local copy of Exceptions.py and Site.py, and
> Os.py to build my micro-python embedded environment up, and put them in a
> subdirectory called Lib under where the EXE is located.  So far so good,
but
> how do I get the traceback message for why 'import site' is failing?

better make that "exceptions.py" and "site.py".  and
the standard "site.py" imports "os.py", which imports
"ntpath.py", which imports "stat.py" and so on.

I'd recommend using "exceptions.py" and an empty
(or at least user-defined) "site.py".

you can also run the standard interpreter with the
-v option, down in your micro-python environment,
so see what's going on.

hope this helps!

</F>





More information about the Python-list mailing list