Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #590 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

pywin32 compatibility error

Reported by: mayankpj@… Owned by: htgoebel
Priority: normal Milestone: PyInstaller 2.1
Component: Hooks Version: 2.0
Severity: major Keywords: pythoncom
Cc:

Description

I am using "pywin32-217.win32-py2.7.exe" with script built on python 2.7, I get warning while buiding:

8160 WARNING: pythoncom is changing its name to pythoncom27
8191 WARNING: pywintypes is changing its name to pywintypes27

The dist directory contains files: "pythoncom27.dll" and "pywintypes27.dll"

runnning the executable gives following error:

Traceback (most recent call last):
  File "<string>", line 65, in <module>
  File "C:\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in doimport
    exec co in mod.__dict__
  File "C:\pyinstaller-2.0\LnT_Model\build\pyi.win32\LnT_Model\out00-PYZ.pyz\win32com", line 6, in <module>
  File "C:\pyinstaller-2.0\PyInstaller\loader\iu.py", line 409, in importHook
    raise ImportError("No module named %s" % fqname)
ImportError: No module named pythoncom

I have read that installing pywin32 version 212 resolves the issue, but they did not release exe installer for python 27. Any help will be appreciated.

Attachments

Change History

comment:1 Changed 9 months ago by matysek

PyInstaller? is renaming these modules and adding 27 to then. It is really ancient code and I'm not sure why it is doing. We need to verify that. Could you post here any code example?

comment:2 Changed 9 months ago by anonymous

I import a library called pandas, simple script with just one line can be used to reproduce the error:

import pandas as pd
print "Hello World!"

comment:3 Changed 9 months ago by mayankpj@…

I had posted the problem with pandas developers on https://github.com/pydata/pandas/issues/1787 but have received no replies as of now.

comment:4 Changed 9 months ago by matysek

  • Priority changed from highest to normal
  • Severity changed from critical to major
  • Milestone set to PyInstaller 2.1

One thing I do not understand is why it is picking up modules pythoncom and pywintypes. Somehow pyinstaller is not processing hooks for pythoncom but it includes it's runtime hook part.

Could you please as a workaround try the following code in your app?

import pythoncom

comment:5 Changed 9 months ago by matysek

  • Status changed from new to closed
  • Resolution set to fixed

Could you please try latest dev version? I think it should be fixed there now.

comment:6 Changed 9 months ago by mayankpj@…

dear matysek,

I have tried with developer version of pyinstaller and the latest version of pandas with python 2.7.2.

A one line script "import pandas" did not work either. I also noticed that using xlrd and some other modules in my script also produce warning about pythoncoms but still runs OK on various systems.

comment:7 Changed 9 months ago by matysek

The following message should be now gone.

WARNING: pythoncom is changing its name to pythoncom27

Do you experience now a different error or is it still the same?

If you are experiencing a different error then it is probably related directly to pandas and not to pythoncom module. In this case please open a new bug report related to panda.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.