LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Python Node - win32com.client

    Employee
    Posted 07-25-2017 12:56

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jpstory

    Hi All

    I have a Python node which is created to remove file-opening password embedded in Excel files.
    What it does is that it opens Excel the Application behind the screen and remove the password and save the file and exit the application.

    One of the key modules used is win32com and this node has been working fine in lavastorm 5.1 version.
    The problem is when runs in 6.1 version it throws up an error saying "No module named win32.client".

    When I manually looked up the directory, I can see the module was actually installed at the following directory, which is the same as 5.1 version:

    Lavastorm\LAE 4.6\platform\windows-x86-32\python\Lib\site-packages\win32com\client

    Lavastorm\LAE6.1\platform\windows-x86-32\python\Lib\site-packages\win32com\client


    Can you explain what caused the issue and how to fix it, thanks!


  • 2.  RE: Python Node - win32com.client

    Employee
    Posted 07-26-2017 07:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jpstory

    Bump

    Can anyone please hlep on this one, thanks!


  • 3.  RE: Python Node - win32com.client

    Employee
    Posted 07-26-2017 09:15

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    A bit if a stab in the dark but...

    Is the installed package the one for Python 2.7 instead of Python 3.1?

    Are you using the 32-bit version rather than the 64-bit?


  • 4.  RE: Python Node - win32com.client

    Employee
    Posted 07-26-2017 09:54

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    As a test you could bypass the node logic and just see what happens if you use the Python interpreter.

    Open a cmd window and navigate to the Python install used by LAE, e.g.

    C:\Program Files\Lavastorm\LAE6.1\platform\windows-x86-32\python

    and type Python <Enter>

    You should then be able to import the required module, e.g.

    from win32com.client import Dispatch

    You should then be returned to the command prompt if the module was found


  • 5.  RE: Python Node - win32com.client

    Employee
    Posted 07-26-2017 10:22

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jpstory

    Hi awilliams1024

    Thanks for looking at this!

    I think the Python installed on my PC is version 2.7 and 32 bit becasue when I open up the interpreter it says Python 2.7.3 [MCS v.1500 32 bit <Intel>] on win32 on the top line.

    I did not install win32com package manually, it came with Lavastorm 6.1 when I installed LAE.
    So I am assuming the package should be compatible with whatever Python's version is.

    However, when I executed command "import win32com" and "import win32com.client" on the intepreter, I got the following error message:
    "ImportError: DLL load failed: The specified module could not be found."

    Does that mean the win32com package actually has a different version (64 bit) than Python ( presumably 32 bit) ?


  • 6.  RE: Python Node - win32com.client

    Employee
    Posted 07-27-2017 07:34

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: jpstory

    Bump

    Hi awilliams1024

    Appreicaite if you could provide an answer, thanks


  • 7.  RE: Python Node - win32com.client

    Employee
    Posted 07-27-2017 08:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    Up-front Caveat: I don't pretend to have much knowledge about Python system dependencies.

    However, looking online at similar issues other people have had it appears that the reported problem is the inability to load the win32api module due to missing DLL files. I believe the pywin32_system32 module may be missing from the install. Check if they are in the following directory:

    Lavastorm\LAE6.1\platform\windows-x86-32\python\Lib\site-packages\pywin32_system32

    If it is missing you can get the three DLLs from here:

    https://github.com/saltstack/salt-wi...win32_system32

    They need to be copied into the Lavastorm\LAE6.1\platform\windows-x86-32\python\Lib\site-packages\pywin32_system32 directory.

    If they are present then copying the existing DLL files to Lavastorm\LAE6.1\platform\windows-x86-32\python\Lib\site-packages\win32 directory may help.


  • 8.  RE: Python Node - win32com.client

    Employee
    Posted 07-27-2017 12:09

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: awilliams1024

    If you get this error when running the node and attempting to "import win32com.client" :

    [Errno 13] Permission denied: 'C:\\Program Files (x86)\\Lavastorm\\LAE6.1\\platform\\windows-x86-32\\python\\lib\\site-packages\\win32com\\gen_py\\__init__.py'

    This article:

    https://www.pyxll.com/_forum/index.php?topic=292.0

    indicates the reason for the failure is the presence of the following directory:

    C:\Program Files (x86)\Lavastorm\LAE6.1\platform\windows-x86-32\python\Lib\site-packages\win32com\gen_py

    Renaming (or deleting) the directory causes win32com to write its files to %TEMP% directory instead (which I think is the preferred operation, imo).