pyinstaller failded to excute script library - pyinstaller

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.

Related

ModuleNotFoundError 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.

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.

pyinstaller warnings stopped but executable file does not work

Why does the executable not work? I followed the top instructions of an older, similar, problem and the warnings (missing dlls) stopped, the executable was created in the dist folder but it does not work on double click. Here is a copy of the screen, having typed the two lines below:
C:\Users\User\Desktop\SAVE THESE>PATH=%PATH%;C:\Windows\System32\downlevel;
C:\Users\User\Desktop\SAVE THESE>pyinstaller -w -F WFinder_v2db.py
343 INFO: PyInstaller: 3.4
359 INFO: Python: 3.7.2
359 INFO: Platform: Windows-10-10.0.17763-SP0
359 INFO: wrote C:\Users\User\Desktop\SAVE THESE\WFinder_v2db.spec
374 INFO: UPX is not available.
390 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Desktop\\SAVE THESE', 'C:\\Users\\User\\Desktop\\SAVE THESE']
390 INFO: checking Analysis
390 INFO: Building Analysis because Analysis-00.toc is non existent
390 INFO: Initializing module dependency graph...
406 INFO: Initializing module graph hooks...
421 INFO: Analyzing base_library.zip ...
14258 INFO: running Analysis Analysis-00.toc
14258 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\user\appdata\local\programs\python\python37-32\python.exe
16813 INFO: Caching module hooks...
16828 INFO: Analyzing C:\Users\User\Desktop\SAVE THESE\WFinder_v2db.py
18375 INFO: Processing pre-safe import module hook urllib3.packages.six.moves
25757 INFO: Loading module hooks...
25757 INFO: Loading module hook "hook-certifi.py"...
25773 INFO: Loading module hook "hook-encodings.py"...
26112 INFO: Loading module hook "hook-lxml.etree.py"...
26112 INFO: Loading module hook "hook-pydoc.py"...
26112 INFO: Loading module hook "hook-xml.py"...
26442 INFO: Loading module hook "hook-_tkinter.py"...
27245 INFO: checking Tree
27245 INFO: Building Tree because Tree-00.toc is non existent
27245 INFO: Building Tree Tree-00.toc
27762 INFO: checking Tree
27762 INFO: Building Tree because Tree-01.toc is non existent
27762 INFO: Building Tree Tree-01.toc
27963 INFO: Looking for ctypes DLLs
27963 INFO: Analyzing run-time hooks ...
27963 INFO: Including run-time hook 'pyi_rth__tkinter.py'
27994 INFO: Looking for dynamic libraries
30947 INFO: Looking for eggs
30947 INFO: Using Python library c:\users\user\appdata\local\programs\python\python37-32\python37.dll
30949 INFO: Found binding redirects:[]
30967 INFO: Warnings written to C:\Users\User\Desktop\SAVE THESE\build\WFinder_v2db\warn-WFinder_v2db.txt
31169 INFO: Graph cross-reference written to C:\Users\User\Desktop\SAVE THESE\build\WFinder_v2db\xref-WFinder_v2db.html
31360 INFO: checking PYZ
31360 INFO: Building PYZ because PYZ-00.toc is non existent
31362 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\SAVE THESE\build\WFinder_v2db\PYZ-00.pyz
33153 INFO: Building PYZ (ZlibArchive) C:\Users\User\Desktop\SAVE THESE\build\WFinder_v2db\PYZ-00.pyz completed successfully.
33209 INFO: checking PKG
33209 INFO: Building PKG because PKG-00.toc is non existent
33209 INFO: Building PKG (CArchive) PKG-00.pkg
48156 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
48312 INFO: Bootloader c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
48312 INFO: checking EXE
48312 INFO: Building EXE because EXE-00.toc is non existent
48312 INFO: Building EXE from EXE-00.toc
48312 INFO: Appending archive to EXE C:\Users\User\Desktop\SAVE THESE\dist\WFinder_v2db.exe
49562 INFO: Building EXE from EXE-00.toc completed successfully.
My mistake was that I had forgotten the closing line root.mainloop() in the GUI (tkinter) code. Now the executable works. A missing line of code did give me the trouble.

rJava import not working in airflow

I am trying to schedule some r script in airflow, I am using rJava library in my script. rJava and xlsx is working fine in R terminal, but not in airflow environment. I am getting this error,
libjvm.so: cannot open shared object file: No such file or directory
In my ~/.bashrc file,
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/bin/jar
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/lib/amd64:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
In my ~/.profile file,
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/bin/jar
export HADOOP_HOME='/home/ubuntu/spark-2.2.0-bin-hadoop2.7/hadoop-2.7.4'
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
export LD_LIBRARY_PATH=$HADOOP_HOME/lib/native/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server:$LD_LIBRARY_PATH
In my /etc/environment,
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/bin/jar";
LD_LIBRARY_PATH="/usr/lib/jvm/java-8-openjdk-amd64/lib/amd64:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server";
Also, I tried to add this line in the top of my R script before importing rJava,
system('export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/bin/jar')
system('export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-openjdk-amd64/lib/amd64:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server')
Even then I keep getting libjvm.so file missing error. But I can see that file in /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
When I checked the log in airflow, the dag is running the script in Temporary script location: /tmp/airflowtmp7Ws3X2//tmp/airflowtmp7Ws3X2/nz-property-report6vTyGr
I think it is not picking the environment variables, getting this error,
Loading required package: xlsx
[2018-08-09 21:39:23,755] {base_task_runner.py:98} INFO - Subtask: [2018-08-09 21:39:23,755] {bash_operator.py:101} INFO - Error: package or namespace load failed for ‘xlsx’:
[2018-08-09 21:39:23,755] {base_task_runner.py:98} INFO - Subtask: [2018-08-09 21:39:23,755] {bash_operator.py:101} INFO - .onLoad failed in loadNamespace() for 'rJava', details:
[2018-08-09 21:39:23,755] {base_task_runner.py:98} INFO - Subtask: [2018-08-09 21:39:23,755] {bash_operator.py:101} INFO - call: dyn.load(file, DLLpath = DLLpath, ...)
[2018-08-09 21:39:23,755] {base_task_runner.py:98} INFO - Subtask: [2018-08-09 21:39:23,755] {bash_operator.py:101} INFO - error: unable to load shared object '/home/ubuntu/R/x86_64-pc-linux-gnu-library/3.4/rJava/libs/rJava.so':
[2018-08-09 21:39:23,756] {base_task_runner.py:98} INFO - Subtask: [2018-08-09 21:39:23,755] {bash_operator.py:101} INFO - libjvm.so: cannot open shared object file: No such file or directory
Can anyone help me with using rJava in my R script in airflow?
EDIT: As requested, here is my DAG script,
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
#from airflow.models import DAG
from datetime import datetime
dag = DAG(
dag_id='property_report',
schedule_interval=None,
)
task = BashOperator(
task_id='report',
dag=dag,
bash_command="Rscript /home/ubuntu/airflow/dags/scripts/r-scripts/recreate_lastmonthreport_from_snapshotdata.R",
start_date=airflow.utils.dates.days_ago(1),
owner='airflow')
Just to help anyone looking for an answer for this. I just had to source ~/.bashrc in both screens running web server and scheduler separately and restart them. It picked up the env variables fine.

Pyinstaller - WindowsError: [Error 126] The specified module could not be found

Hello learned readers,
I'm having some trouble creating an exe using pyinstaller, whereby during run time, I'm receiving the error message:
File "<string>", line 17, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geometry", line 4, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geometry.base", line 9, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.coords", line 8, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.geos", line 15, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyi_importers.py", line 270, in load_module
exec(bytecode, module.__dict__)
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\shapely.libgeos", line 184, in <module>
File "C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\out00-PYZ.pyz\ctypes", line 365, in __init__
WindowsError: [Error 126] The specified module could not be found
As far as I know, this is a dll problem. However it does not specify which once is causing the problem. I've debugged using --log-level=debug and pasted this below. I've also checked the warning message from pyinstaller and haven't been able to discern the cause of the error.
Any thought of suggestions as to what could be causing this error?
Many thanks
Snip taken from the output of the buildtime:
24094 INFO: Adding Microsoft.VC90.MFC to dependent assemblies of final executable
24222 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
24223 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86.manifest
24223 INFO: Searching for file mfc90.dll
24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfc90.dll
24225 INFO: Searching for file mfc90u.dll
24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfc90u.dll
24225 INFO: Searching for file mfcm90.dll
24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfcm90.dll
24225 INFO: Searching for file mfcm90u.dll
24225 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\mfcm90u.dll
26147 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_none ...
26147 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57.manifest
26148 INFO: Searching for file msvcr90.dll
26148 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcr90.dll
26148 INFO: Searching for file msvcp90.dll
26148 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcp90.dll
26149 INFO: Searching for file msvcm90.dll
26149 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\msvcm90.dll
26516 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
27055 INFO: Using Python library C:\Windows\system32\python27.dll
27253 INFO: Warnings written to C:\Users\Hp\PycharmProjects\GISdev\build\gis_helper2\warngis_helper2.txt
27286 INFO: checking PYZ
27286 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
27286 INFO: building PYZ (ZlibArchive) out00-PYZ.toc
33585 INFO: checking PKG
33585 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
33585 INFO: building PKG (CArchive) out00-PKG.pkg
60197 INFO: checking EXE
60197 INFO: rebuilding out00-EXE.toc because GIS_Helper.exe missing
60197 INFO: building EXE from out00-EXE.toc
60202 INFO: Appending archive to EXE C:\Users\Hp\PycharmProjects\GISdev\dist\GIS_Helper.exe
The problem was the geos_c.dll file. Pyinstaller was not picking it up automatically. I tried copying this to the build directory where the spec file was being executed from. This wasn't enough however and the solution was to edit the spec file to include the geos_c.dll
# -*- mode: python -*-
a = Analysis(['GIS_Helper.py'],
pathex=['C:\\Users\\Hp\\PycharmProjects\\GISdev'],
hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack', 'scipy.special._ufuncs_cxx', 'multiprocessing', '_multiprocessing', 'multiprocessing.process', 'multiprocessing.util', 'ctypes.util', 'pandas.util', 'distutils.util', 'shapely'],
hookspath=None,
runtime_hooks=None)
a.binaries=['geos_c.dll', 'geos_c.dll', 'BINARY'],
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
[('v',None,'OPTION')],
a.binaries,
a.zipfiles,
a.datas,
name='GIS_Helper.exe',
debug=True,
strip=None,
upx=True,
console=True )

Resources