Skip to content

import error with pyinstaller, related to pythoncom; pywin32 #1787

Closed
@mayankpj

Description

@mayankpj

I am using pywin32 217, python 2.7.2 and pandas developer version:
My script contains only one line:
import pandas as pd

When I run the compiled executable created using pyinstaller in debug mode, i get the following error:

_MEIPASS2 is NULL
archivename is C:\pyinstaller-devel\TestImport\dist\TestImport\TestImport.exe
No need to extract files to run; setting extractionpath to homepath
Already in the child - running!
manifestpath: C:\pyinstaller-devel\TestImport\dist\TestImport\TestImport.exe.manifest
Activation context created
Activation context activated
C:\pyinstaller-devel\TestImport\dist\TestImport\python27.dll
Manipulating evironment
PYTHONPATH=C:/pyinstaller-devel/TestImport/dist/TestImport
PYTHONHOME=C:/pyinstaller-devel/TestImport/dist/TestImport/
importing modules from CArchive
extracted iu
extracted struct
extracted archive
Installing import hooks
out00-PYZ.pyz
Running scripts
Traceback (most recent call last):
File "", line 65, in
File "E:\Software\Python\PyInstaller\pyinstaller-pyinstaller-2d4aecc\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "E:\Software\Python\PyInstaller\pyinstaller-pyinstaller-2d4aecc\PyInstaller\loader\iu.py", line 480, in doimport
exec co in mod.dict
File "C:\pyinstaller-devel\TestImport\build\pyi.win32\TestImport\out00-PYZ.pyz\win32com", line 6, in
File "E:\Software\Python\PyInstaller\pyinstaller-pyinstaller-2d4aecc\PyInstaller\loader\iu.py", line 409, in importHook
raise ImportError("No module named %s" % fqname)
ImportError: No module named pythoncom
RC: -1 from pyi_rth_win32comgenpy
OK.
Deactivating activation context
Releasing activation context
Done

I get import error saying no module named pythoncom, to avoid this , i have also tried to explicitly import pythoncom in my script, the script runs fine but the error with executable still remains.
I have tried with earlier versions of pandas as well as pywin32 (i could go back to pywin 213 only)
I noticed in issue #1136 that the problem was resolved with developer version of pandas, but it doesn't work for me..
Any quick pointers will be really appreciated a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildLibrary building on various platforms

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions