embeb python 2.3
i have a c++ program that embebs python 2.3 in windows.
when i execute this program in other machines the follow message appears in the console:
''import site'' failed use -v for tracebak
anyone knows what is this about?
because all the scripts work perfectly.(i think)
thanks.
well, ''import'' is used to import a module, and if you move the code to another machine without moving the ''site'' module, you would run into that error I suppose. Try searching for ''site.py'' or ''site.pyc'' on your development (''main'') computer and copy that to the same location on the other machines.
Chris Pergrossi
My Realm | "Good Morning, Dave"
Chris Pergrossi
My Realm | "Good Morning, Dave"
Chris PergrossiMy Realm | "Good Morning, Dave"
Also make sure site.py (or .pyc, or .pyd) is in sys.path. Do this in your static extension module OR in every source file:
Also it may help to use pdb. In each script import pdb and then encase the entire script in try/except. If an unhandled exception occurs call pdb.pm() (prints a traceback and gives you python debugger prompt if stdin is available without crashing your embedded app)
import syssys.path.append(''./relative/path/to/scripts'')
Also it may help to use pdb. In each script import pdb and then encase the entire script in try/except. If an unhandled exception occurs call pdb.pm() (prints a traceback and gives you python debugger prompt if stdin is available without crashing your embedded app)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement