ModuleNotFoundError pyinstaller - pyinstaller

I have my python script as "vrProcessSpecsForA0.py"
# %% imports
import os
import re
import pandas as pd
from pathlib import Path
from img.core.cloud import StagedImage, Stager, BasicImage
from img.dev.vr import VRSrc
from img.engine.vr_processors import roughness_processor
from img.engine.vr_processors import ripple_processor
from img.engine.vr_mlc_defect import MeanLocalCurvatureProcessor
from img.engine.vr_mechanical_stress import MechanicalStressProcessor
from img.util.img_util import normalize_255
from metrics_pb2 import MetricsProto
from basic_pb2 import Region
# Body of my code commented out
I am executing my python codes in a virtual environment on Linux and the code runs properly in vscode IDE. Now I try to make an exe file from it using the command below in the terminal:
(pvenv) marablu#LT-HZ9Q5J3:~/pylib-img/local_tests$ pyinstaller --onedir vr_ProcessSpecsForA0.py
24 INFO: PyInstaller: 5.0.dev0
24 INFO: Python: 3.8.10
29 INFO: Platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29
29 INFO: wrote /home/marablu/pylib-img/local_tests/vr_ProcessSpecsForA0.spec
52 INFO: UPX is not available.
52 INFO: Extending PYTHONPATH with paths
['/home/marablu/pylib-img/local_tests']
...
...
...
33384 INFO: Building PKG (CArchive) vr_ProcessSpecsForA0.pkg completed successfully.
33385 INFO: Bootloader /home/marablu/pvenv/lib/python3.8/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
33385 INFO: checking EXE
33386 INFO: Rebuilding EXE-00.toc because pkg is more recent
33386 INFO: Building EXE from EXE-00.toc
33388 INFO: Copying bootloader EXE to /home/marablu/pylib-img/local_tests/build/vr_ProcessSpecsForA0/vr_ProcessSpecsForA0
33388 INFO: Appending PKG archive to custom ELF section in EXE
33412 INFO: Building EXE from EXE-00.toc completed successfully.
33417 INFO: checking COLLECT
WARNING: The output directory "/home/marablu/pylib-img/local_tests/dist/vr_ProcessSpecsForA0" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
On your own risk, you can use the option `--noconfirm` to get rid of this question.
68431 INFO: Removing dir /home/marablu/pylib-img/local_tests/dist/vr_ProcessSpecsForA0
68534 INFO: Building COLLECT COLLECT-00.toc
68971 INFO: Building COLLECT COLLECT-00.toc completed successfully.
(pvenv) marablu#LT-HZ9Q5J3:~/pylib-img/local_tests$ cd dist/vr_ProcessSpecsForA0
(pvenv) marablu#LT-HZ9Q5J3:~/pylib-img/local_tests/dist/vr_ProcessSpecsForA0$ ./vr_ProcessSpecsForA0
Traceback (most recent call last):
File "vr_ProcessSpecsForA0.py", line 6, in <module>
ModuleNotFoundError: No module named 'img'
[23291] Failed to execute script 'vr_ProcessSpecsForA0' due to unhandled exception!
(pvenv) marablu#LT-HZ9Q5J3:~/pylib-img/local_tests/dist/vr_ProcessSpecsForA0$
I added
path1="/home/pylib-img/img"
pathex['path1']
in the spec file and rebuilt the exe using "pyinstaller vr_ProcessSpecsForA0.spec" but did not help.
Any suggestion on how to solve this issue? Also, please do not recommend links that are not exactly tackling this issue. I have gone through almost all of them and none has solved the issue.

Related

Can't setup PySide6, error occured when running "from PySide6.QtCore import Qt" in python

I tried to install pyside6, its installation was successful (Successfully installed pyside6-6.2.4 shiboken6-6.2.4).
But I can't run the "Hello World Program" of PySide6, and when executing
from PySide6 import QtCore, QtWidgets, QtGui, error occurs:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libQt6Core.so.6: cannot open shared object file: No such file or directory
P.S.
My python version: 3.8.10; pyside version: 6.2.4; Linux kernel: 4.4.0-19041-Microsoft
Problem Solved by:
strip --remove-section=.note.ABI-tag ~/env/lib/python3.8/sitepackages/PySide6/Qt/lib/libQt6Core.so.6
This problem seemed to result from an outdated kernel (or, underdeveloped wsl kernel). Indeed, update wsl to wsl2 may solve this problem further.
Reference:
Why does PySide6 on GitLab CI result in ImportError?
https://askubuntu.com/questions/1034313/ubuntu-18-4-libqt5core-so-5-cannot-open-shared-object-file-no-such-file-or-dir/1163268#1163268

pyinstaller failded to excute script library

I have an Error only when I make my python file to exe.
(When I start my python file it works well)
And This is my TraceBack Error.
Traceback (most recent call last):
FileNotFoundError: [Errno 2] No such file or directory: >>'C:\Users\USER\AppData\Local\Temp\_MEI65802\wordcloud\stopwords'
But I installed wordcloud already.
Here is my code.
from konlpy.tag import Okt
from wordcloud import WordCloud
from collections import Counter
import matplotlib.pyplot as plt
from tkinter import *
import tkinter.messagebox
from datetime import datetime
#tk 활성화
root = Tk()
root.title("워드클라우드 생성 프로그램_By.RaccoonTeacher")
root.resizable(True, True)
def create_wordcloud():
txt_value = txt_wordcloud.get(index1 = "0.0", index2 = "end")
entry_value = entry_stopword.get()
entry_value = set(entry_value.split(" "))
nouns = tagging.nouns(txt_value)
nouns = [noun for noun in nouns if not noun in entry_value]
count_nouns = Counter(nouns)
result = wordcloud.generate_from_frequencies(count_nouns)
file_name = datetime.now().strftime("%Y%m%d") + "wordcloud.png"
plt.tight_layout()
plt.axis("off")
result.to_file(file_name)
tkinter.messagebox.showinfo(title="완료", message="생성 완료")
root.quit()
# 워드클라우드 프로그래밍
tagging = Okt()
wordcloud = WordCloud(font_path="C:\Windows\Fonts\HMFMOLD.TTF",
max_font_size=200,
background_color="#FFFFFF",
width = 800, height = 800)
#Label_설명_워드클라우드
lbl_wordcloud = Label(root, text="아래에 워드클라우드를 만들 문장을 넣어주세요")
lbl_wordcloud.pack()
#Text_워드클라우드 문장 입력
txt_wordcloud = Text(root)
txt_wordcloud.pack()
lbl_stopword = Label(root, text="워드클라우드에 표시 되지 않았으면 하는 낱말을 적어주세요.\n\"띄어쓰기\"로 각 낱말을 구분해주시면 됩니다")
lbl_stopword.pack()
entry_stopword = Entry(root)
entry_stopword.pack(expand=True)
#Button_생성
btn_make = Button(root, text="생성", command = create_wordcloud)
btn_make.pack()
root.mainloop()
'''
And just in cae you need to see my pyinstaller transforming log, I add it below.
'''
96 INFO: PyInstaller: 4.10
96 INFO: Python: 3.10.2
117 INFO: Platform: Windows-10-10.0.18363-SP0
119 INFO: wrote C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\program_wordcloud.spec
123 INFO: UPX is not available.
129 INFO: Extending PYTHONPATH with paths
['C:\\Users\\USER\\OneDrive - 서울창림초등학교\\0. '
'Python\\folder_data\\Mywork\\ProgramWordcloud']
764 INFO: checking Analysis
765 INFO: Building Analysis because Analysis-00.toc is non existent
765 INFO: Initializing module dependency graph...
771 INFO: Caching module graph hooks...
799 INFO: Analyzing base_library.zip ...
5304 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
5306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib'
6774 INFO: Caching module dependency graph...
6962 INFO: running Analysis Analysis-00.toc
6978 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Users\USER\AppData\Local\Programs\Python\Python310\python.exe
7062 INFO: Analyzing C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\program_wordcloud.py
10663 INFO: Processing pre-find module path hook site from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
10665 INFO: site: retargeting to fake-dir 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\fake-modules'
17069 INFO: Processing pre-safe import module hook six.moves from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
24992 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
34619 INFO: Processing module hooks...
34620 INFO: Loading module hook 'hook-jpype.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\jpype\\_pyinstaller'...
34727 INFO: Loading module hook 'hook-certifi.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
34735 INFO: Loading module hook 'hook-cryptography.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
35024 INFO: Loading module hook 'hook-IPython.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
35615 INFO: Loading module hook 'hook-jedi.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
37729 INFO: Loading module hook 'hook-jinja2.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
37730 INFO: Loading module hook 'hook-jsonschema.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
37770 INFO: Loading module hook 'hook-lxml.etree.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
37772 INFO: Loading module hook 'hook-lxml.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
38916 INFO: Loading module hook 'hook-nbformat.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
39026 INFO: Loading module hook 'hook-parso.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
39055 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
39056 INFO: Loading module hook 'hook-zmq.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
40786 INFO: Loading module hook 'hook-difflib.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
40793 INFO: Loading module hook 'hook-distutils.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
40795 INFO: Loading module hook 'hook-distutils.util.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
40802 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
40902 INFO: Loading module hook 'hook-gevent.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
41482 INFO: Determining a mapping of distributions to packages...
73621 WARNING: Unable to find package for requirement zope.event from package gevent.
73621 WARNING: Unable to find package for requirement zope.interface from package gevent.
73622 INFO: Packages required by gevent:
['greenlet', 'setuptools', 'cffi']
74787 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
74794 INFO: Loading module hook 'hook-lib2to3.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
74862 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
75766 INFO: Matplotlib backend "GTK3Agg": ignored
backend Gtk3Agg requires cairo
76218 INFO: Matplotlib backend "GTK3Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
76652 INFO: Matplotlib backend "GTK4Agg": ignored
backend Gtk4Agg requires cairo
77080 INFO: Matplotlib backend "GTK4Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
77507 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx' from 'matplotlib.backends' (C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\matplotlib\backends\__init__.py)
78627 INFO: Matplotlib backend "nbAgg": added
79052 INFO: Matplotlib backend "QtAgg": ignored
Failed to import any qt binding
79473 INFO: Matplotlib backend "QtCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
79908 INFO: Matplotlib backend "Qt5Agg": ignored
Failed to import any qt binding
80342 INFO: Matplotlib backend "Qt5Cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
81277 INFO: Matplotlib backend "TkAgg": added
82237 INFO: Matplotlib backend "TkCairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
82915 INFO: Matplotlib backend "WebAgg": added
83851 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
84276 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
84715 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
85256 INFO: Matplotlib backend "agg": added
85676 INFO: Matplotlib backend "cairo": ignored
cairo backend requires that pycairo>=1.11.0 or cairocffi is installed
86705 INFO: Matplotlib backend "pdf": added
87729 INFO: Matplotlib backend "pgf": added
88385 INFO: Matplotlib backend "ps": added
88943 INFO: Matplotlib backend "svg": added
89855 INFO: Matplotlib backend "template": added
90126 INFO: Loading module hook 'hook-matplotlib.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90570 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90576 INFO: Loading module hook 'hook-numpy.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90678 INFO: Import to be excluded not found: 'f2py'
90696 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90701 INFO: Loading module hook 'hook-packaging.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90702 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
90709 INFO: Loading module hook 'hook-PIL.Image.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
91039 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
91045 INFO: Loading module hook 'hook-PIL.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
91066 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
91071 INFO: Loading module hook 'hook-pkg_resources.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
91632 INFO: Processing pre-safe import module hook win32com from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
92153 WARNING: Hidden import "pkg_resources.py2_warn" not found!
92206 WARNING: Hidden import "pkg_resources.markers" not found!
92211 INFO: Loading module hook 'hook-pygments.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
93940 INFO: Loading module hook 'hook-scipy.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
93947 INFO: Loading module hook 'hook-setuptools.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
94901 INFO: Loading module hook 'hook-sqlite3.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95014 INFO: Loading module hook 'hook-sysconfig.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95015 INFO: Loading module hook 'hook-wcwidth.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95029 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95259 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95259 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95260 INFO: Loading module hook 'hook-xml.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95261 INFO: Loading module hook 'hook-zope.interface.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95272 INFO: Loading module hook 'hook-_tkinter.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
95470 INFO: checking Tree
95470 INFO: Building Tree because Tree-00.toc is non existent
95471 INFO: Building Tree Tree-00.toc
95560 INFO: checking Tree
95560 INFO: Building Tree because Tree-01.toc is non existent
95560 INFO: Building Tree Tree-01.toc
95684 INFO: checking Tree
95684 INFO: Building Tree because Tree-02.toc is non existent
95685 INFO: Building Tree Tree-02.toc
95690 INFO: Loading module hook 'hook-lxml.isoschematron.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
95707 INFO: Loading module hook 'hook-lxml.objectify.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
95709 INFO: Loading module hook 'hook-pythoncom.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
96255 INFO: Loading module hook 'hook-pywintypes.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
96826 INFO: Loading module hook 'hook-win32com.py' from 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
97388 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks'...
97535 INFO: Looking for ctypes DLLs
97728 INFO: Analyzing run-time hooks ...
97743 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
97746 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
97748 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
97752 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
97756 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
97758 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
97759 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
97764 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
97767 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Roaming\\Python\\Python310\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_traitlets.py'
97769 INFO: Including run-time hook 'C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_mplconfig.py'
97807 INFO: Looking for dynamic libraries
98978 INFO: Looking for eggs
98979 INFO: Using Python library C:\Users\USER\AppData\Local\Programs\Python\Python310\python310.dll
98979 INFO: Found binding redirects:
[]
99004 INFO: Warnings written to C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\build\program_wordcloud\warn-program_wordcloud.txt
99290 INFO: Graph cross-reference written to C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\build\program_wordcloud\xref-program_wordcloud.html
99461 INFO: checking PYZ
99461 INFO: Building PYZ because PYZ-00.toc is non existent
99462 INFO: Building PYZ (ZlibArchive) C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\build\program_wordcloud\PYZ-00.pyz
102882 INFO: Building PYZ (ZlibArchive) C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\build\program_wordcloud\PYZ-00.pyz completed successfully.
102957 INFO: checking PKG
102957 INFO: Building PKG because PKG-00.toc is non existent
102958 INFO: Building PKG (CArchive) program_wordcloud.pkg
115648 INFO: Building PKG (CArchive) program_wordcloud.pkg completed successfully.
115746 INFO: Bootloader C:\Users\USER\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
115747 INFO: checking EXE
115747 INFO: Building EXE because EXE-00.toc is non existent
115748 INFO: Building EXE from EXE-00.toc
115748 INFO: Copying bootloader EXE to C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\dist\program_wordcloud.exe.notanexecutable
115762 INFO: Copying icon to EXE
115762 INFO: Copying icons from ['C:\\Users\\USER\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-windowed.ico']
115765 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
115765 INFO: Writing RT_ICON 1 resource with 3752 bytes
115765 INFO: Writing RT_ICON 2 resource with 2216 bytes
115765 INFO: Writing RT_ICON 3 resource with 1384 bytes
115766 INFO: Writing RT_ICON 4 resource with 38188 bytes
115766 INFO: Writing RT_ICON 5 resource with 9640 bytes
115766 INFO: Writing RT_ICON 6 resource with 4264 bytes
115766 INFO: Writing RT_ICON 7 resource with 1128 bytes
115774 INFO: Copying 0 resources to EXE
115775 INFO: Emedding manifest in EXE
115777 INFO: Updating manifest in C:\Users\USER\OneDrive - 서울창림초등학교\0. Python\folder_data\Mywork\ProgramWordcloud\dist\program_wordcloud.exe.notanexecutable
115779 INFO: Updating resource type 24 name 1 language 0
115789 INFO: Appending PKG archive to EXE
126884 INFO: Building EXE from EXE-00.toc completed successfully.

struct.error: 'i' format requires -2147483648 <= number <= 2147483647 while creating stand alone executable using PyInstaller

I am trying to create a stand alone executable of the script afsara3.py using PyInstaller. I am getting this error
struct.error: 'i' format requires -2147483648 <= number <= 2147483647
but cannot figure out why. It seems like the problem occurs while doing
Building PKG (CArchive) PKG-00.pkg
I cannot provide the script because the script isn't supposed to be made public
After running -
pyinstaller --specpath ./dist --distpath ./dist --workpath ./dist --onefile ./afsara3.py
368 INFO: PyInstaller: 4.0
368 INFO: Python: 3.6.9
377 INFO: Platform: Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic
378 INFO: wrote ./dist/afsara3.spec
394 INFO: UPX is not available.
400 INFO: Extending PYTHONPATH with paths
['/home/afsara-ben/Downloads/coding assignment/src',
'/home/afsara-ben/Downloads/coding assignment/src/dist']
537 INFO: checking Analysis
2786 INFO: Building because /home/afsara-ben/Downloads/coding assignment/src/afsara3.py changed
2786 INFO: Initializing module dependency graph...
2799 INFO: Caching module graph hooks...
2833 INFO: Analyzing base_library.zip ...
6192 INFO: Caching module dependency graph...
6255 INFO: running Analysis Analysis-00.toc
6303 INFO: Analyzing afsara3.py
7149 INFO: Processing pre-find module path hook distutils from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
7181 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.6'
8643 INFO: Processing pre-find module path hook site from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
8650 INFO: site: retargeting to fake-dir '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/fake-modules'
13561 INFO: Processing pre-safe import module hook six.moves from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
23794 INFO: Processing module hooks...
23794 INFO: Loading module hook 'hook-lxml.etree.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23800 INFO: Loading module hook 'hook-certifi.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23811 INFO: Loading module hook 'hook-openpyxl.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23851 INFO: Loading module hook 'hook-pkg_resources.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
24243 INFO: Processing pre-safe import module hook win32com from '/home/afsara-ben/.local/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
24245 WARNING: Hidden import "pkg_resources.py2_warn" not found!
24245 WARNING: Hidden import "pkg_resources.markers" not found!
24247 INFO: Excluding import '__main__'
24249 INFO: Removing import of __main__ from module pkg_resources
24249 INFO: Loading module hook 'hook-PIL.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
24259 INFO: Import to be excluded not found: 'PySide'
24259 INFO: Import to be excluded not found: 'tkinter'
24259 INFO: Excluding import 'PyQt4'
24261 INFO: Import to be excluded not found: 'FixTk'
24261 INFO: Excluding import 'PyQt5'
24262 INFO: Removing import of PyQt5.QtCore from module PIL.ImageQt
24263 INFO: Removing import of PyQt5.QtGui from module PIL.ImageQt
24263 INFO: Loading module hook 'hook-numpy.core.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
25202 INFO: Loading module hook 'hook-setuptools.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
25889 INFO: Loading module hook 'hook-xml.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
25900 INFO: Loading module hook 'hook-PyQt5.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47189 WARNING: Hidden import "PyQt5.sip" not found!
47189 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47444 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47480 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47481 INFO: Loading module hook 'hook-xml.dom.domreg.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47482 INFO: Loading module hook 'hook-pytz.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47483 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
47572 INFO: Loading module hook 'hook-pandas.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
50178 INFO: Loading module hook 'hook-PIL.Image.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
50845 INFO: Loading module hook 'hook-lib2to3.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
50870 INFO: Loading module hook 'hook-matplotlib.backends.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
52994 INFO: Matplotlib backend "GTK3Agg": added
53501 INFO: Matplotlib backend "GTK3Cairo": added
53770 INFO: Matplotlib backend "MacOSX": ignored
cannot import name '_macosx'
54036 INFO: Matplotlib backend "nbAgg": ignored
No module named 'IPython'
-c:12: MatplotlibDeprecationWarning:
The matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
54508 INFO: Matplotlib backend "Qt4Agg": added
-c:12: MatplotlibDeprecationWarning:
The matplotlib.backends.backend_qt4cairo backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
54934 INFO: Matplotlib backend "Qt4Cairo": added
55312 INFO: Matplotlib backend "Qt5Agg": added
55696 INFO: Matplotlib backend "Qt5Cairo": added
56323 INFO: Matplotlib backend "TkAgg": added
56752 INFO: Matplotlib backend "TkCairo": added
57025 INFO: Matplotlib backend "WebAgg": ignored
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg.py", line 27, in <module>
import tornado
ModuleNotFoundError: No module named 'tornado'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_webagg.py", line 29, in <module>
raise RuntimeError("The WebAgg backend requires Tornado.") from err
RuntimeError: The WebAgg backend requires Tornado.
57438 INFO: Matplotlib backend "WX": ignored
No module named 'wx'
57697 INFO: Matplotlib backend "WXAgg": ignored
No module named 'wx'
57970 INFO: Matplotlib backend "WXCairo": ignored
No module named 'wx'
58280 INFO: Matplotlib backend "agg": added
58592 INFO: Matplotlib backend "cairo": added
59056 INFO: Matplotlib backend "pdf": added
59466 INFO: Matplotlib backend "pgf": added
59780 INFO: Matplotlib backend "ps": added
60112 INFO: Matplotlib backend "svg": added
60516 INFO: Matplotlib backend "template": added
60708 INFO: Processing pre-safe import module hook gi.repository.Gio from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.Gio.py'.
60724 INFO: Processing pre-safe import module hook gi.repository.GLib from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.GLib.py'.
60725 INFO: Processing pre-safe import module hook gi.repository.GObject from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.GObject.py'.
60735 INFO: Processing pre-safe import module hook gi.repository.Gtk from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.Gtk.py'.
60736 INFO: Processing pre-safe import module hook gi.repository.Gdk from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.Gdk.py'.
61248 INFO: Loading module hook 'hook-gi.repository.Gtk.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78487 INFO: Processing pre-safe import module hook gi.repository.xlib from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.xlib.py'.
78492 INFO: Processing pre-safe import module hook gi.repository.Atk from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.Atk.py'.
78509 INFO: Loading module hook 'hook-sqlite3.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78592 INFO: Loading module hook 'hook-numpy.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78593 INFO: Loading module hook 'hook-distutils.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78593 INFO: Loading module hook 'hook-sysconfig.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78611 INFO: Loading module hook 'hook-gi.repository.Gio.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
78878 INFO: Loading module hook 'hook-_tkinter.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
79036 INFO: checking Tree
79047 INFO: checking Tree
79049 INFO: Loading module hook 'hook-matplotlib.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
79322 INFO: Loading module hook 'hook-encodings.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
79506 INFO: Loading module hook 'hook-gi.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
79541 INFO: Loading module hook 'hook-gi.repository.GLib.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
79848 INFO: Loading module hook 'hook-gi.repository.Gdk.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80002 INFO: Processing pre-safe import module hook gi.repository.cairo from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.cairo.py'.
80003 INFO: Processing pre-safe import module hook gi.repository.Pango from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.Pango.py'.
80004 INFO: Processing pre-safe import module hook gi.repository.GdkPixbuf from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.GdkPixbuf.py'.
80004 INFO: Loading module hook 'hook-gi.repository.cairo.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80147 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80152 INFO: Import to be excluded not found: 'FixTk'
80152 INFO: Excluding import 'tkinter'
80153 INFO: Loading module hook 'hook-gi.repository.Atk.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80347 INFO: Loading module hook 'hook-gi.repository.GObject.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80506 WARNING: Hidden import "gi._gobject" not found!
80507 INFO: Loading module hook 'hook-gi.repository.xlib.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80632 INFO: Loading module hook 'hook-gi.repository.Pango.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
80777 INFO: Loading module hook 'hook-gi.repository.GdkPixbuf.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
81114 INFO: Processing pre-safe import module hook gi.repository.GModule from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-gi.repository.GModule.py'.
81116 INFO: Loading module hook 'hook-gi.repository.GModule.py' from '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks'...
82059 INFO: Looking for ctypes DLLs
82341 WARNING: library user32 required via ctypes not found
82472 WARNING: library msvcrt required via ctypes not found
82491 INFO: Analyzing run-time hooks ...
82505 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
82506 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
82509 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth__tkinter.py'
82509 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pyqt5.py'
82510 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gdkpixbuf.py'
82511 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gtk.py'
82512 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_glib.py'
82512 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gio.py'
82513 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gi.py'
82514 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_mplconfig.py'
82515 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/hooks/rthooks/pyi_rth_mpldata.py'
82515 INFO: Including run-time hook '/home/afsara-ben/.local/lib/python3.6/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_certifi.py'
82536 INFO: Looking for dynamic libraries
89670 INFO: Looking for eggs
89670 INFO: Python library not in binary dependencies. Doing additional searching...
89716 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
89733 INFO: Warnings written to ./dist/afsara3/warn-afsara3.txt
89840 INFO: Graph cross-reference written to ./dist/afsara3/xref-afsara3.html
94490 INFO: checking PYZ
94537 INFO: Building because toc changed
94537 INFO: Building PYZ (ZlibArchive) ./dist/afsara3/PYZ-00.pyz
96136 INFO: Building PYZ (ZlibArchive) ./dist/afsara3/PYZ-00.pyz completed successfully.
96443 INFO: checking PKG
96443 INFO: Building PKG because PKG-00.toc is non existent
96443 INFO: Building PKG (CArchive) PKG-00.pkg
Traceback (most recent call last):
File "/home/afsara-ben/.local/bin/pyinstaller", line 11, in <module>
sys.exit(run())
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/__main__.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/__main__.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 720, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 667, in build
exec(code, spec_namespace)
File "./dist/afsara3.spec", line 33, in <module>
console=True )
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/api.py", line 437, in __init__
upx_exclude=self.upx_exclude
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/api.py", line 200, in __init__
self.__postinit__()
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
self.assemble()
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/building/api.py", line 285, in assemble
pylib_name=pylib_name)
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/archive/writers.py", line 332, in __init__
super(CArchiveWriter, self).__init__(archive_path, logical_toc)
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/archive/writers.py", line 64, in __init__
self._finalize()
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/archive/writers.py", line 96, in _finalize
self.save_trailer(toc_pos)
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/archive/writers.py", line 439, in save_trailer
tocstr = self.toc.tobinary()
File "/home/afsara-ben/.local/lib/python3.6/site-packages/PyInstaller/archive/writers.py", line 264, in tobinary
flag, ord(typcd), nm + pad))
struct.error: 'i' format requires -2147483648 <= number <= 2147483647
I had the same problems and found the following solution for me:
Use a virtual environment (you can follow this tutorial which provides clear explanations).
Fix pandastable and matplotlib (in my case, the error was connected in some way with pandastable, but I'm not sure which was the exact problem.

Apache Airflow initdb command fails, due to syntax error

I have created virtualenv for python3 using:
virtualenv -p $(which python3) ENV
Then activate the source
source /Users/myusername/ENV/bin/activate
Install the apache-airflow:
pip install apache-airflow
then which airflow yields /Users/myusername/ENV/bin/airflow
But when I try to initdb using:
airflow initdb
I get below error:
{db.py:350} INFO - Creating tables
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
WARNI [airflow.utils.log.logging_mixin.LoggingMixin] cryptography not found - values will not be stored encrypted.
ERROR [airflow.models.DagBag] Failed to import: /Library/Python/2.7/site-packages/airflow/example_dags/example_http_operator.py
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/airflow/models/__init__.py", line 413, in process_file
m = imp.load_source(mod_name, filepath)
File "/Library/Python/2.7/site-packages/airflow/example_dags/example_http_operator.py", line 27, in <module>
from airflow.operators.http_operator import SimpleHttpOperator
File "/Library/Python/2.7/site-packages/airflow/operators/http_operator.py", line 21, in <module>
from airflow.hooks.http_hook import HttpHook
File "/Library/Python/2.7/site-packages/airflow/hooks/http_hook.py", line 23, in <module>
import tenacity
File "/Library/Python/2.7/site-packages/tenacity/__init__.py", line 375, in <module>
from tenacity.tornadoweb import TornadoRetrying
File "/Library/Python/2.7/site-packages/tenacity/tornadoweb.py", line 24, in <module>
from tornado import gen
File "/Library/Python/2.7/site-packages/tornado-6.0.3-py2.7-macosx-10.14-intel.egg/tornado/gen.py", line 126
def _value_from_stopiteration(e: Union[StopIteration, "Return"]) -> Any:
^
SyntaxError: invalid syntax
Done.
(ENV) ---------------------------------------------------------
Seems like example scripts use python 2.7 and it can't recognize the function definition syntax.
Does apache-airflow package need to be fixed by the next release or I can do something to fix this?
I tried fixing this:
Use python2.7 instead of python3
then install airflow on default python 2.7 enabled on mac but this throws other errors like package "six" is not compatible.
You need to turn off the example DAGs to be loaded in config file to solve this problem.
Anyway, it seems weird that airflow uses 2.7 Python when you told that it is installed into Python 3 virtual environment.

ImportError: No module named _sqlite3 in Jinja2 template

I've just migrated from the Python 2.5 to the 2.7 runtime, and most of server I've written runs fine. However I'm occassionaly seeing this odd stack trace (I've hacked it down for brevity):
ERROR 2013-04-23 10:40:15,598 wsgi.py:235]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "templates/querystart.html", line 30, in top-level template code
{% for session in sessions %}
ImportError: No module named _sqlite3
I've not imported sqlite3 myself, and I don't rely on it. The code that's calling it is pretty simple (perhaps bordering on the dumb side of things):
class UserIdQuery(BaseHandler):
def get(self):
sessionQuery=Session.all().order("userid")
template_values = {
'sessions': sessionQuery,
}
self.render_template('querystart.html',**template_values)
The above simply extends the below (taken from a very helpful migration tutorial)
class BaseHandler(webapp2.RequestHandler):
#webapp2.cached_property
def jinja2(self):
return jinja2.get_jinja2(app=self.app)
def render_template(self, filename, **template_args):
self.response.write(self.jinja2.render_template(filename, **template_args))
Anyone know what might be triggering the import error? Thanks,
Appengine uses sqlite for the datastore, my bet is your python2.7 installed on OSX is missing the sqlite binary library. Do a quick test, start a python interpreter (outside of appengine) and try to import sqlite3
$ python
Python 2.7.3 (default, Sep 26 2012, 21:53:58)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>
If that fails you know you have an incomplete 2.7 runtime installed.
I was having the same problem and fixed it.
I was running python 2.7.3 that I installed from Ninite.com.
Uninstalled python, downloaded and installed 2.7.5 installer directly from python.org and problem has gone away.

Resources