Install python with win32 win32 extensions on a network drive

I need a large number of computers running Windows XP to run the same version of python with a set of modules, one of which is python-win32. I was thinking of installing python on a network drive that is mounted by all client machines, and just configure the path on the clients. Python starts fine from the network, but when importing win32com I get a pop-up message with the message:

Procedure entry point? PyWinObject_AsHANDLE @@ YAHPAU_object @@ PAPAXH @Z cannot be placed in the pywintypes24.dll dynamic link library

after rejecting the dialog box of the message I get in the console:

ImportError: Error loading DLL: the specified procedure was not found.

I searched the python directory for pywintypes24.dll and is present in "Lib \ site-packages \ pywin32_system32".

What am I missing, and is there any other way when I can install the Python + Python-Win32 + add-on module once and run them on many machines? I don't have access to Microsoft system management tools, so I need to be a little lower tech than that.

+6
python windows networking share
source share
4 answers

On each machine, you should basically run the following pywin32_postinstall.py -install once. Assuming your python installation on network N:\Python26 , run the following command for each client:

 N:\Python26\python.exe N:\Python26\Scripts\pywin32_postinstall.py -install 

Another important thing is Good Luck! . The reason is that you may need to do this as admin . In my case, this setting worked for all but one computer. I still do not understand why.

+7
source share

Python (or OS, for sure) searches for DLL files using os.environ ["PATH"], and not by looking for sys.path.

So, you can run Python using a simple .cmd file instead, which adds \ server \ share \ python26 to the path (given that the installer (or you) copied the DLLs from \ server \ share \ python26 \ lib \ site-packages \ pywin32-system32 to \ server \ share \ python26).

Or you can add the following code to your scripts before you try to import win32api, etc.:

  # Add Python installation directory to the path, # because on Windows 7 the pywin32 installer fails to copy # the required DLLs to the %WINDIR%\System32 directory and # copies them to the Python installation directory instead. # Fortunately, in Python it is possible to modify the PATH # before loading the DLLs. os.environ["PATH"] = sys.prefix + ";" + os.environ.get("PATH") import win32gui import win32con 
+1
source share

"" I searched the python directory for pywintypes24.dll and is present in "Lib \ site-packages \ pywin32_system32" "". The existence of the dll is not in doubt. Is this entry point to this dll?

Have you tried to install the exact same configuration on a offline drive?

Have you tried to import other modules into a package?

Have you checked the dll with the dependency walker or something similar?

Does the value "24" in pywintypes24.dll mean Python 2.4? What version of Python are you using?

0
source share

You can use the batch files launched at boot time in

  • Connect a network resource ( net use \\server\share )
  • Copy Python installations and packages from a network share to a local folder
  • Check the version of the MSI installer for the installed version.
  • If different, uninstall Python and all version-specific packages
  • Reinstall all packages

This will pretty much minimize your own central management system for this software.

0
source share

All Articles