"module object has no attribute ClassType' when exe imports os module

107 views
Skip to first unread message

Malibu

unread,
Aug 22, 2019, 12:26:02 PM8/22/19
to PyInstaller
Hi there, I have a tricky problem.. I have an application with wxpython and twisted and I'm trying to build on Red Hat 7 and Python 2.7.5.  The pyinstaller command seems to run clean, but when I try to execute it, I get the following error:

Traceback (most recent call last):
  File "PyInstaller/loader/pyiboot01_bootstrap.py", line 25, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "/home/user/virtualenvs/pb/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "/home/user/virtualenvs/pb/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "/home/user/virtualenvs/pb/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "types.py", line 11, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "dbus/__init__.py", line 103, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "dbus/_dbus.py", line 39, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "dbus/bus.py", line 26, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "logging/__init__.py", line 26, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "weakref.py", line 12, in <module>
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "/home/user/virtualenvs/pb/lib/python2.7/UserDict.py", line 83, in <module>
    import _abcoll
  File "/tmp/pip-build-CMeqHy/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "/home/user/virtualenvs/pb/lib/python2.7/_abcoll.py", line 70, in <module>
    Iterable.register(str)
  File "/home/user/virtualenvs/pb/lib/python2.7/abc.py", line 107, in register
    if not isinstance(subclass, (type, types.ClassType)):
AttributeError: 'module' object has no attribute 'ClassType'
[8649] Failed to execute script pyiboot01_bootstrap

I'm not really sure how to tackle this issue.  I guess I could prune back my application so that it is a very basic wxpython app and go from there, but I was hoping someone could recommend something that would be less work.  If I make a basic 'hello world' it does work.  Here is my pyinstaller output in case it helps, thanks for the help.



NFO:PyInstaller.__main__:PyInstaller: 3.4
INFO:PyInstaller.__main__:Python: 2.7.5
INFO:PyInstaller.__main__:Platform: Linux-3.10.0-862.14.4.el7.x86_64-x86_64-with-redhat-7.5-Maipo
INFO:PyInstaller.configure:UPX is not available.
INFO:PyInstaller.building.build_main:Removing temporary files and cleaning cache in /home/user/.cache/pyinstaller
INFO:PyInstaller.building.build_main:Extending PYTHONPATH with paths
['/home/user/data/PycharmProjects/pushbutton',
 '/home/user/virtualenvs/pb/lib64/python2.7/site-packages',
 '/home/user/data/PycharmProjects/pushbutton']
INFO:PyInstaller.building.datastruct:checking Analysis
INFO:PyInstaller.building.datastruct:Building Analysis because Analysis-00.toc is non existent
INFO:PyInstaller.depend.analysis:Initializing module dependency graph...
INFO:PyInstaller.depend.analysis:Initializing module graph hooks...
INFO:PyInstaller.depend.analysis:Analyzing hidden import 'MySQLdb'
ERROR:PyInstaller.depend.analysis:Hidden import 'MySQLdb' not found
INFO:PyInstaller.depend.analysis:Analyzing hidden import 'sqlalchemy.sql.functions.func'
INFO:PyInstaller.depend.analysis:Processing pre-safe import module hook   _xmlplus
INFO:PyInstaller.depend.analysis:Processing pre-find module path hook   distutils
INFO:PyInstaller.utils.hooks:distutils: retargeting to non-venv dir '/usr/lib64/python2.7/distutils'
ERROR:PyInstaller.depend.analysis:Hidden import 'sqlalchemy.sql.functions.func' not found
INFO:PyInstaller.building.build_main:running Analysis Analysis-00.toc
INFO:PyInstaller.building.build_main:Caching module hooks...
INFO:PyInstaller.building.build_main:Analyzing d3_buddy.py
INFO:PyInstaller.depend.analysis:Processing pre-safe import module hook   six.moves
INFO:PyInstaller.building.build_main:Loading module hooks...
INFO:PyInstaller.building.imphook:Loading module hook "hook-distutils.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-sysconfig.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-xml.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-selenium.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-keyring.backends.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-xml.dom.domreg.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-pkg_resources.py"...
INFO:PyInstaller.depend.analysis:Processing pre-safe import module hook   win32com
INFO:PyInstaller.building.imphook:Loading module hook "hook-nacl.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-regex.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-pytz.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-httplib.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-encodings.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-sqlalchemy.py"...
INFO:PyInstaller.utils.hooks:  Found 3 sqlalchemy hidden imports
WARNING:PyInstaller.building.imphook:Hidden import "MySQLdb" not found!
WARNING:PyInstaller.building.imphook:Hidden import "sqlalchemy.sql.functions.func" not found!
INFO:PyInstaller.building.imphook:Excluding import 'sqlalchemy.testing'
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.engines
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.engines
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.engines
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.engines
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.mock
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.config
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.util from module sqlalchemy.orm.util
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.util
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.util
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing.util
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.exclusions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.exclusions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.util from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.config from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.warnings from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.engines from module sqlalchemy.testing
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.util from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.mock from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.assertsql from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.config from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.exclusions from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertions
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing.assertions from module sqlalchemy.testing.warnings
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.warnings
INFO:PyInstaller.building.imphook:  Removing import of sqlalchemy.testing from module sqlalchemy.testing.assertsql
INFO:PyInstaller.building.imphook:Loading module hook "hook-xml.etree.cElementTree.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-cryptography.py"...
INFO:PyInstaller.building.imphook:Loading module hook "hook-sqlite3.py"...
INFO:PyInstaller.building.build_main:Looking for ctypes DLLs
WARNING:PyInstaller.depend.utils:library user32 required via ctypes not found
INFO:PyInstaller.depend.analysis:Analyzing run-time hooks ...
INFO:PyInstaller.depend.analysis:Including run-time hook 'pyi_rth_pkgres.py'
INFO:PyInstaller.depend.analysis:Including run-time hook 'pyi_rth_multiprocessing.py'
INFO:PyInstaller.building.build_main:Looking for dynamic libraries
INFO:PyInstaller.building.build_main:Looking for eggs
INFO:PyInstaller.building.build_main:Using Python library /lib64/libpython2.7.so.1.0
INFO:PyInstaller.building.build_main:Warnings written to /home/user/data/PycharmProjects/pushbutton/build/d3_buddy/warn-d3_buddy.txt
INFO:PyInstaller.building.build_main:Graph cross-reference written to /home/user/data/PycharmProjects/pushbutton/build/d3_buddy/xref-d3_buddy.html
INFO:PyInstaller.building.datastruct:checking PYZ
INFO:PyInstaller.building.datastruct:Building PYZ because PYZ-00.toc is non existent
INFO:PyInstaller.building.api:Building PYZ (ZlibArchive) /home/user/data/PycharmProjects/pushbutton/build/d3_buddy/PYZ-00.pyz
INFO:PyInstaller.building.api:Building PYZ (ZlibArchive) /home/user/data/PycharmProjects/pushbutton/build/d3_buddy/PYZ-00.pyz completed successfully.
INFO:PyInstaller.building.datastruct:checking PKG
INFO:PyInstaller.building.datastruct:Building PKG because PKG-00.toc is non existent
INFO:PyInstaller.building.api:Building PKG (CArchive) PKG-00.pkg
INFO:PyInstaller.building.api:Building PKG (CArchive) PKG-00.pkg completed successfully.
INFO:PyInstaller.building.api:Bootloader /home/user/virtualenvs/pb/lib/python2.7/site-packages/PyInstaller/bootloader/Linux-64bit/run
INFO:PyInstaller.building.datastruct:checking EXE
INFO:PyInstaller.building.datastruct:Building EXE because EXE-00.toc is non existent
INFO:PyInstaller.building.api:Building EXE from EXE-00.toc
INFO:PyInstaller.building.api:Appending archive to ELF section in EXE /home/user/data/PycharmProjects/pushbutton/build/d3_buddy/d3_buddy
INFO:PyInstaller.building.api:Building EXE from EXE-00.toc completed successfully.
INFO:PyInstaller.building.datastruct:checking COLLECT
INFO:PyInstaller.building.datastruct:Building COLLECT because COLLECT-00.toc is non existent
WARNING: The output directory "/home/user/data/PycharmProjects/pushbutton/dist/d3_buddy" and ALL ITS CONTENTS will be REMOVED! Continue? (y/n)y
INFO:PyInstaller.building.utils:Removing dir /home/user/data/PycharmProjects/pushbutton/dist/d3_buddy
INFO:PyInstaller.building.api:Building COLLECT COLLECT-00.toc
INFO:PyInstaller.building.api:Building COLLECT COLLECT-00.toc completed successfully.
Reply all
Reply to author
Forward
0 new messages