Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"build-local.sh dr2" : AttributeError: 'NoneType' object has no attribute 'groups' #58

Closed
fenugrec opened this issue Mar 1, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@fenugrec
Copy link

fenugrec commented Mar 1, 2021

Hi !
it appears I'm failing again at bundling, this time for dirt2 :

$ sh resources/build-local.sh dr2
Building for dr2
115 INFO: PyInstaller: 4.1
115 INFO: Python: 3.9.1
117 INFO: Platform: Linux-5.10.17-1-lts-x86_64-with-glibc2.33
121 INFO: UPX is not available.
122 INFO: Extending PYTHONPATH with paths
['/home/q/d/dirt-rally-time-recorder/timerecorder',
 '/home/q/d/dirt-rally-time-recorder']
126 INFO: checking Analysis
126 INFO: Building Analysis because Analysis-00.toc is non existent
126 INFO: Initializing module dependency graph...
129 INFO: Caching module graph hooks...
132 INFO: Analyzing base_library.zip ...
1867 INFO: Processing pre-find module path hook distutils from '/usr/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
1867 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.9'
3648 INFO: Processing pre-safe import module hook win32com from '/usr/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
6025 INFO: Processing pre-find module path hook site from '/usr/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
6025 INFO: site: retargeting to fake-dir '/usr/lib/python3.9/site-packages/PyInstaller/fake-modules'
8208 INFO: Caching module dependency graph...
8344 INFO: running Analysis Analysis-00.toc
8371 INFO: Analyzing timerecorder/timerecord.py
8661 INFO: Processing module hooks...
8661 INFO: Loading module hook 'hook-appdirs.py' from '/usr/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
8663 INFO: Excluding import of win32com from module appdirs
8663 INFO: Loading module hook 'hook-pytest.py' from '/usr/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
9572 INFO: Loading module hook 'hook-sqlite3.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9640 INFO: Loading module hook 'hook-pickle.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9644 INFO: Excluding import of argparse from module pickle
9644 INFO: Loading module hook 'hook-lib2to3.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9662 INFO: Loading module hook 'hook-importlib_metadata.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9662 INFO: Loading module hook 'hook-distutils.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9664 INFO: Loading module hook 'hook-distutils.util.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9665 INFO: Excluding import of lib2to3.refactor from module distutils.util
9665 INFO: Loading module hook 'hook-pkg_resources.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9726 WARNING: Hidden import "pkg_resources.py2_warn" not found!
9727 WARNING: Hidden import "pkg_resources.markers" not found!
9730 INFO: Excluding import of __main__ from module pkg_resources
9730 INFO: Loading module hook 'hook-heapq.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9731 INFO: Excluding import of doctest from module heapq
9731 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
9731 INFO: Loading module hook 'hook-pygments.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
11792 INFO: Loading module hook 'hook-packaging.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
11792 INFO: Loading module hook 'hook-numpy._pytesttester.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
11794 INFO: Excluding import of pytest from module numpy._pytesttester
11794 INFO: Loading module hook 'hook-setuptools.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
11847 INFO: Import to be excluded not found: 'setuptools.py27compat'
11848 INFO: Import to be excluded not found: 'setuptools.py33compat'
11848 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
11849 INFO: Excluding import of numpy from module setuptools.msvc
11849 INFO: Loading module hook 'hook-PIL.Image.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12263 INFO: Loading module hook 'hook-difflib.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12265 INFO: Excluding import of doctest from module difflib
12265 INFO: Loading module hook 'hook-numpy.core.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12312 INFO: Loading module hook 'hook-numpy.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12313 INFO: Loading module hook 'hook-PIL.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12315 INFO: Excluding import of PyQt5.QtGui from module PIL.ImageQt
12315 INFO: Excluding import of PyQt5.QtCore from module PIL.ImageQt
12317 INFO: Excluding import of tkinter from module PIL.ImageTk
12317 INFO: Import to be excluded not found: 'FixTk'
12317 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12317 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
ldd: warning: you do not have execution permission for `/usr/lib/python3.9/site-packages/PyQt5/QtCore.abi3.so'
12414 WARNING: Unable to find Qt5 translations /usr/share/qt/translations/qtbase_*.qm. These translations were not packaged.
12415 INFO: Loading module hook 'hook-xml.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12415 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
ldd: warning: you do not have execution permission for `/usr/lib/python3.9/site-packages/PyQt5/QtGui.abi3.so'
12458 WARNING: Unable to find Qt5 translations /usr/share/qt/translations/qtbase_*.qm. These translations were not packaged.
12459 INFO: Loading module hook 'hook-zope.interface.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12465 INFO: Excluding import of unittest from module zope.interface._compat
12465 INFO: Loading module hook 'hook-encodings.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12531 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12534 INFO: Import to be excluded not found: 'FixTk'
12534 INFO: Loading module hook 'hook-sysconfig.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12540 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12541 INFO: Excluding import of test from module multiprocessing.util
12542 INFO: Loading module hook 'hook-pycparser.py' from '/usr/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
12542 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
12544 INFO: Excluding import of numpy from module PIL.ImageFilter
12544 INFO: Loading module hook 'hook-PyQt5.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
14390 WARNING: Hidden import "sip" not found!
14391 INFO: Loading module hook 'hook-_tkinter.py' from '/usr/lib/python3.9/site-packages/PyInstaller/hooks'...
14504 INFO: checking Tree
14504 INFO: Building Tree because Tree-00.toc is non existent
14504 INFO: Building Tree Tree-00.toc
14514 INFO: checking Tree
14515 INFO: Building Tree because Tree-01.toc is non existent
14515 INFO: Building Tree Tree-01.toc
14549 INFO: checking Tree
14549 INFO: Building Tree because Tree-02.toc is non existent
14549 INFO: Building Tree Tree-02.toc
14601 INFO: Looking for ctypes DLLs
Traceback (most recent call last):
  File "/usr/bin/pyinstaller", line 33, in <module>
    sys.exit(load_entry_point('pyinstaller==4.1', 'console_scripts', 'pyinstaller')())
  File "/usr/lib/python3.9/site-packages/PyInstaller/__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/usr/lib/python3.9/site-packages/PyInstaller/__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 720, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 667, in build
    exec(code, spec_namespace)
  File "timerecord.spec", line 13, in <module>
    a = Analysis(['timerecorder/timerecord.py'],
  File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
    self.__postinit__()
  File "/usr/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
    self.assemble()
  File "/usr/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 437, in assemble
    ctypes_binaries = scan_code_for_ctypes(co)
  File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 145, in scan_code_for_ctypes
    binaries = _resolveCtypesImports(binaries)
  File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 319, in _resolveCtypesImports
    load_ldconfig_cache()
  File "/usr/lib/python3.9/site-packages/PyInstaller/depend/utils.py", line 402, in load_ldconfig_cache
    path = m.groups()[-1]
AttributeError: 'NoneType' object has no attribute 'groups'
resources/build-local.sh: line 13: cd: dist/timerecorder-dr2: No such file or directory
rm: cannot remove 'sqlite3.exe': No such file or directory
mv: cannot stat 'list-laptimes.bat': No such file or directory
mv: cannot stat 'export-laptimes.bat': No such file or directory
sed: can't read *-laptimes.sh: No such file or directory
rm: cannot remove 'timerecorder': Is a directory
cp: cannot stat '../../timerecorder': No such file or directory

I see you recently did some work to support py 3.9 and pyinstaller 4.1, is this related or is there something else at play ?

@maxbechtold
Copy link
Collaborator

Indeed it made sense to switch to Python 3.9 for pyinstaller 4.x.

I seem not to be able to reproduce this on Git Bash for Windows, see below how it plays out for me.

Actually this seems to be an issue with pyinstaller on certain Linux distros that has been fixed recently (pyinstaller/pyinstaller#5540). Let's see if the next pyinstaller release works better for you once integrated, for now I recommend to build based on release 2.10.2 which has an older pyinstaller version but feature-wise the same.

$ sh resources/build-local.sh dr2
Building for dr2
51 INFO: PyInstaller: 4.2
51 INFO: Python: 3.9.1
52 INFO: Platform: Windows-10-10.0.19041-SP0
54 INFO: UPX is not available.
55 INFO: Extending PYTHONPATH with paths
['C:\\PROJECTS\\maxbe\\dirt-rally-time-recorder\\timerecorder',
 'C:\\PROJECTS\\maxbe\\dirt-rally-time-recorder']
61 INFO: checking Analysis
61 INFO: Building Analysis because Analysis-00.toc is non existent
61 INFO: Initializing module dependency graph...
63 INFO: Caching module graph hooks...
71 WARNING: Several hooks defined for module 'win32ctypes.core'. Please take care they do not conflict.
75 INFO: Analyzing base_library.zip ...
2192 INFO: Processing pre-find module path hook distutils from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2193 INFO: distutils: retargeting to non-venv dir 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib'
2693 INFO: Caching module dependency graph...
2759 INFO: running Analysis Analysis-00.toc
2761 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\users\max\appdata\local\programs\python\python39\python.exe
2786 WARNING: lib not found: api-ms-win-core-path-l1-1-0.dll dependency of c:\users\max\appdata\local\programs\python\python39\python39.dll
2807 INFO: Analyzing timerecorder\timerecord.py
3037 INFO: Processing module hooks...
3038 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3038 INFO: Excluding import of doctest from module difflib
3038 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3040 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3111 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3112 INFO: Excluding import of doctest from module heapq
3112 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3112 INFO: Excluding import of argparse from module pickle
3113 INFO: Loading module hook 'hook-sqlite3.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3182 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3183 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
3361 INFO: Looking for ctypes DLLs
3361 INFO: Analyzing run-time hooks ...
3364 INFO: Looking for dynamic libraries
3417 INFO: Looking for eggs
3417 INFO: Using Python library c:\users\max\appdata\local\programs\python\python39\python39.dll
3417 INFO: Found binding redirects:
[]
3426 INFO: Warnings written to C:\PROJECTS\maxbe\dirt-rally-time-recorder\build\timerecord\warn-timerecord.txt
3451 INFO: Graph cross-reference written to C:\PROJECTS\maxbe\dirt-rally-time-recorder\build\timerecord\xref-timerecord.html
3456 INFO: Appending 'binaries' from .spec
3457 INFO: Appending 'datas' from .spec
3459 INFO: checking PYZ
3459 INFO: Building PYZ because PYZ-00.toc is non existent
3459 INFO: Building PYZ (ZlibArchive) C:\PROJECTS\maxbe\dirt-rally-time-recorder\build\timerecord\PYZ-00.pyz
3791 INFO: Building PYZ (ZlibArchive) C:\PROJECTS\maxbe\dirt-rally-time-recorder\build\timerecord\PYZ-00.pyz completed successfully.
3798 INFO: checking PKG
3799 INFO: Building PKG because PKG-00.toc is non existent
3799 INFO: Building PKG (CArchive) PKG-00.pkg
3809 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
3810 INFO: Bootloader c:\users\max\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
3810 INFO: checking EXE
3810 INFO: Building EXE because EXE-00.toc is non existent
3810 INFO: Building EXE from EXE-00.toc
3811 INFO: Copying icons from ['c:\\users\\max\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
3812 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
3812 INFO: Writing RT_ICON 1 resource with 3752 bytes
3812 INFO: Writing RT_ICON 2 resource with 2216 bytes
3812 INFO: Writing RT_ICON 3 resource with 1384 bytes
3812 INFO: Writing RT_ICON 4 resource with 37019 bytes
3812 INFO: Writing RT_ICON 5 resource with 9640 bytes
3812 INFO: Writing RT_ICON 6 resource with 4264 bytes
3812 INFO: Writing RT_ICON 7 resource with 1128 bytes
3819 INFO: Appending archive to EXE C:\PROJECTS\maxbe\dirt-rally-time-recorder\build\timerecord\timerecord.exe
3821 INFO: Building EXE from EXE-00.toc completed successfully.
3823 INFO: checking COLLECT
3823 INFO: Building COLLECT because COLLECT-00.toc is non existent
3824 INFO: Building COLLECT COLLECT-00.toc
3892 INFO: Building COLLECT COLLECT-00.toc completed successfully.

@maxbechtold maxbechtold added the bug Something isn't working label Mar 1, 2021
@maxbechtold
Copy link
Collaborator

This issue should be fixed with v2.10.4, if you can please try building again on your distro @fenugrec.

@fenugrec
Copy link
Author

Thanks @maxbechtold , I just got around to testing today, and it seems to work now after updating pyinstaller to 4.3

@maxbechtold
Copy link
Collaborator

Glad to hear it, and thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants