Bill Janssen <jans...@parc.com> wrote:

> Mark Hammond <skippy.hamm...@gmail.com> wrote:
> 
> > On 6/04/2010 4:31 PM, Mark Hammond wrote:
> > > On 6/04/2010 4:28 PM, Bill Janssen wrote:
> > >> Mark, my system is a dozen or so Python programs plus a few Windows
> > >> services implemented in Python. If I set those up to hack the "Path"
> > >> environment variable appropriately before importing stuff, could I put
> > >> the three DLLs somewhere else instead of C:\WINDOWS\System32\?
> > >
> > > That might work - although the service could be problematic; this is
> > > started by windows itself, so you don't really get the opportunity to
> > > modify the environment before it starts.
> > 
> > Oops - I missed the point here - you aren't asking about modifying the
> > environment before the process starts, but instead after it starts and
> > before it imports the pywin32 modules.
> > 
> > However, there is still likely to be a problem; the service support
> > depends on a couple of pywin32 modules to bootstrap its world, so by
> > the time your first line of code gets executed, pywintypes,
> > win32service etc will have been loaded (or fatally failed to load)
> 
> Thanks, Mark.
> 
> Just for the moment, I think I'll see if I can get things working by
> copying the DLLs into \WINDOWS\System32\, including Python26.dll.

No luck so far.  I install Python privately ("Just for me" on the Python
installer) in C:\UpLib\1.7.9\python\, and unpack the pywin32 zip file in
the Lib\site-packages\ subdir there.  Then I copy python26.dll and the
two pywin32 DLLs over to C:\WINDOWS\system32\:

$ cp /c/UpLib/1.7.9/python/python26.dll 
/c/UpLib/1.7.9/python/lib/site-packages/pywin32_system32/py*.dll 
/c/WINDOWS/system32/

Then I boot up Python and try to load the win32api:

$ python -i
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: This application has failed to start because the 
application configuration is incorrect. Reinstalling the application may fix 
this problem.
>>> import sys, os
>>> print sys.path
['', 'c:\\UpLib\\1.7.9\\python\\python26.zip', 
'c:\\UpLib\\1.7.9\\python\\DLLs', 'c:\\UpLib\\1.7.9\\python\\lib', 
'c:\\UpLib\\1.7.9\\python\\lib\\plat-win', 
'c:\\UpLib\\1.7.9\\python\\lib\\lib-tk', 'c:\\UpLib\\1.7.9\\python', 
'c:\\UpLib\\1.7.9\\python\\lib\\site-packages', 
'c:\\UpLib\\1.7.9\\python\\lib\\site-packages\\win32', 
'c:\\UpLib\\1.7.9\\python\\lib\\site-packages\\win32\\lib', 
'c:\\UpLib\\1.7.9\\python\\lib\\site-packages\\Pythonwin']
>>> print os.environ.get("Path")
c:\UpLib\1.7.9\python;.;C:\msys\1.0\local\bin;c:\mingw\bin;C:\msys\1.0\bin;c:\Program
 Files\WinAnt\bin;c:\Program Files\MiKTeX 
2.8\miktex\bin;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\Program
 Files\WinAnt\bin
>>> 

So perhaps it's not just a matter of having the DLLs be in the right
place -- maybe I also have to put something in the registry?

I read through the pywin32 installer script again, but I can't see
anything there that might be different.  I've tried putting the
Pythonwin directory, which contains a copy of mfc90.dll, on my Path, as
well, without any luck.

Bill
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to