En Thu, 15 Feb 2007 15:42:51 -0300, <[EMAIL PROTECTED]> escribió: > This is what I get: > > 'import site' failed; use -v for traceback > ['c:\\temp\\pytest\\Debug\\python25_d.zip', 'C:\\Python25\\Lib', 'C:\ > \Python25\\DLLs', 'C:\\Python25\\Lib\\lib-tk', '', 'c:\\temp\\pytest\ > \Debug'] > > In fact, the 'import site' failed; use -v for traceback happens when I > call the Py_Initialize(). > > As can be seen from the output, the import sys; and print sys.path > works. I also added Py_SetProgramName(argv[0]) before calling > PyInitialize() but there was no change.
"works" in the sense that it prints something; but sys.path is incomplete, it lacks site-packages and others (they are added by site.py). It appears that you have installed Python on C:\Python25 and you build your application executable into c:\temp\pytest\Debug - is that true? Hmmm, you will need a debug build of Python too, python25_d.lib/.dll. Perhaps at this stage it's easier to use the Release build, because you already have python25.lib/dll. You have to fix the "import site" error. Use the following command on a console window before launching your executable: set PYTHONVERBOSE=1 You'll see a lot of lines showing the initial imports; you should be able to detect what's the problem at "import site"; usually it's trying to load a missing DLL. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list