Do I need to have site.py available or not ?

M

marcus.obrien

Hi,
on startup my embedded python comes up with "import site failed use
-v". Later python crashes on Pyrun_file(). This is the first time I
have used python and I would like to know does it require site.py to be
read in, and has anyone got an idea how to pass in the -v without using
the python -v command, ie the embedded way. Thanks very much.

Marcus.
 
T

Terry Reedy

Hi,
on startup my embedded python comes up with "import site failed use
-v". Later python crashes on Pyrun_file(). This is the first time I
have used python and I would like to know does it require site.py to be
read in, and has anyone got an idea how to pass in the -v without using
the python -v command, ie the embedded way. Thanks very much.

If by embedded you mean embedded in a C/C++ program, I would look to the
doc for the C API function that you use to start it up to see whether there
is a way to pass in argv flags or to have the same effect.

TJR
 
R

Reinhold Birkenfeld

Terry said:
If by embedded you mean embedded in a C/C++ program, I would look to the
doc for the C API function that you use to start it up to see whether there
is a way to pass in argv flags or to have the same effect.

Also note that '-v' doesn't do what you want here, it merely activates verbose
mode so that you can find the cause for above error. You want '-S'.

Reinhold
 
T

Thomas Heller

Reinhold Birkenfeld said:
Also note that '-v' doesn't do what you want here, it merely activates verbose
mode so that you can find the cause for above error. You want '-S'.

I would say that "import site failed" means that something is wrong.
The '-v' flag helps to find out what and why. The PYTHONVERBOSE
environment variable does the same.

Thomas
 

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

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,983
Latest member
Derek9890

Latest Threads

Top