pywin32 from network install

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • agostino.russo@gmail.com

    #1

    pywin32 from network install

    I managed to make pywin32 work from a network installation (not really
    hard work: a shared folder + copying some dlls + setting PYTHONPATH).
    PythonWin amd COM seem to be working fine from the network install, BUT
    when I need to pass PyTime to a COM object expecting a Date I get the
    following error:

    Python24\Lib\si te-packages\win32c om\client\dynam ic.py", line 251, in
    _ApplyTypes_
    result = self._oleobj_.I nvokeTypes(*(di spid, LCID, wFlags, retType,
    argTypes) + args)
    TypeError: Objects of type 'time' can not be converted to a COM VARIANT

    Note 1: The same code works when using the local installation of
    python/pywin, it only happens when executing the code from a network
    "installati on".

    Note 2: As mentioned other COM components seem to be working when
    running them via pywin from the network install

    Note 3: I am passing pywintipes.Time (datetime.datet ime.today()) to a
    COM object method which expects a Date argument.

    Do I need to change some environment variable/registry settings/other
    hack to fix this?

  • Neil Benn

    #2
    Re: pywin32 from network install

    agostino.russo@ gmail.com wrote:
    [color=blue]
    >I managed to make pywin32 work from a network installation (not really
    >hard work: a shared folder + copying some dlls + setting PYTHONPATH).
    >PythonWin amd COM seem to be working fine from the network install, BUT
    >when I need to pass PyTime to a COM object expecting a Date I get the
    >following error:
    >
    >Python24\Lib\s ite-packages\win32c om\client\dynam ic.py", line 251, in
    >_ApplyTypes_
    > result = self._oleobj_.I nvokeTypes(*(di spid, LCID, wFlags, retType,
    >argTypes) + args)
    >TypeError: Objects of type 'time' can not be converted to a COM VARIANT
    >
    >Note 1: The same code works when using the local installation of
    >python/pywin, it only happens when executing the code from a network
    >"installation" .
    >
    >Note 2: As mentioned other COM components seem to be working when
    >running them via pywin from the network install
    >
    >Note 3: I am passing pywintipes.Time (datetime.datet ime.today()) to a
    >COM object method which expects a Date argument.
    >
    >Do I need to change some environment variable/registry settings/other
    >hack to fix this?
    >
    >
    >[/color]
    Simply moving the win32 install and setting the python path isn't all
    you need to do to get a network install working. In addition, you need
    to remove the win32 from your local install (or piss around with
    sys.path to strip out those local references) as that will automatically
    be included. In addition, there is a registry setting you need to
    delete which automagically adds to the python path - it's in
    HKEY_CURRENT_US ER and HKEY_LOCAL_MACH INE.

    That's probably won't solve your problem but it's somethng to be
    aware of anyways.

    Neil

    --

    Neil Benn
    Senior Automation Engineer
    Cenix BioScience
    BioInnovations Zentrum
    Tatzberg 47
    D-01307
    Dresden
    Germany

    Tel : +49 (0)351 4173 154
    e-mail : benn@cenix-bioscience.com
    Cenix Website : http://www.cenix-bioscience.com

    Comment

    • agostino.russo@gmail.com

      #3
      Re: pywin32 from network install

      Hmm I have the same problem using python -E... Moreover I do not see
      anything strange in the sys.path (Z\LocalApps is my shared folder):

      'Z:\\LocalApps\ \examples',
      'Z:\\LocalApps\ \python\\python 24.zip',
      'Z:\\LocalApps\ \examples',
      'Z:\\LocalApps\ \python\\DLLs',
      'Z:\\LocalApps\ \python\\lib',
      'Z:\\LocalApps\ \python\\lib\\p latwin',
      'Z:\\LocalApps\ \python\\lib\\l ibtk',
      'Z:\\LocalApps\ \python',
      'Z:\\LocalApps\ \python\\lib\\s itepackages',
      'Z:\\LocalApps\ \python\\lib\\s itepackages\\Nu meric',
      'Z:\\LocalApps' ,
      'Z:\\LocalApps\ \python\\lib\\s itepackages\\wi n32',
      'Z:\\LocalApps\ \python\\lib\\s ite-packages\\win3\ \lib',
      'Z:\\LocalApps\ \python\\lib\\s itepackages\\Py thonwin', '
      'Z:\\LocalApps\ \python\\lib\\s ite-packages\\wx-2.6-mswansi'

      BUT when the error is thrown out it is:

      C:\Program
      Files\Python24\ Lib\site-packages\win32c om\client\dynam ic.py...

      Comment

      Working...