I am fairly new to pyinstaller so maybe I am missing something pretty obvious but I am trying to convert a python file to a working executable file via pyinstaller. The .exe gets built and when I try to run it, I get the following message:
Traceback (most recent call last):
File "STC_EXE.py", line 18, in <module>
import geopandas as gpd
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "geopandas\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "geopandas\_config.py", line 109, in <module>
File "geopandas\_config.py", line 95, in _default_use_pygeos
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "geopandas\_compat.py", line 10, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "shapely\__init__.py", line 30, in <module>
File "shapely\__init__.py", line 14, in _delvewheel_init_patch_0_0_18
File "os.py", line 1111, in add_dll_directory
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\WD8322\\AppData\\Local\\Temp\\_MEI153642\\Shapely.libs'
[8328] Failed to execute script 'STC_EXE' due to unhandled exception!
I know that the problem is Shapely.libs is not being detected in the specified location, the issue that I am having is I do not understand why it is not being detected, thus need help fixing it. I've tried manually placing Shapely.libs in the specified path location only to have a new temp folder name missing Shapely.libs. I've gone through my build output and everything seems fine too.
Here is the build output:
C:\Executable_Files\STC ATOLL Automation>pyinstaller --onefile STC_EXE.py
634 INFO: PyInstaller: 5.0.1
634 INFO: Python: 3.9.6
683 INFO: Platform: Windows-10-10.0.19042-SP0
683 INFO: wrote C:\Executable_Files\STC ATOLL Automation\STC_EXE.spec
699 INFO: UPX is not available.
699 INFO: Extending PYTHONPATH with paths
['C:\\Executable_Files\\STC ATOLL Automation']
1716 INFO: checking Analysis
1716 INFO: Building Analysis because Analysis-00.toc is non existent
1716 INFO: Initializing module dependency graph...
1716 INFO: Caching module graph hooks...
1783 INFO: Analyzing base_library.zip ...
4899 INFO: Processing pre-find module path hook distutils from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
4899 INFO: distutils: retargeting to non-venv dir 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib'
8982 INFO: Caching module dependency graph...
9183 INFO: running Analysis Analysis-00.toc
9200 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\wd8322\appdata\local\programs\python\python39\python.exe
9332 INFO: Analyzing C:\Executable_Files\STC ATOLL Automation\STC_EXE.py
11299 INFO: Processing pre-find module path hook site from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
11299 INFO: site: retargeting to fake-dir 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\fake-modules'
20266 INFO: Processing pre-safe import module hook six.moves from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-six.moves.py'.
30949 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
49899 INFO: Processing module hooks...
49899 INFO: Loading module hook 'hook-certifi.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
49916 INFO: Loading module hook 'hook-IPython.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
51500 INFO: Loading module hook 'hook-jedi.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
54554 INFO: Loading module hook 'hook-jinja2.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
54554 INFO: Loading module hook 'hook-jsonschema.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
54599 INFO: Loading module hook 'hook-nbformat.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
54766 INFO: Loading module hook 'hook-openpyxl.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
54999 INFO: Loading module hook 'hook-osgeo.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55049 INFO: Loading module hook 'hook-parso.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55083 INFO: Loading module hook 'hook-pycparser.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55083 INFO: Loading module hook 'hook-pyproj.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55132 INFO: Loading module hook 'hook-rtree.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55149 INFO: Loading module hook 'hook-shapely.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55149 INFO: Loading module hook 'hook-zmq.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
55800 INFO: Loading module hook 'hook-difflib.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
55816 INFO: Loading module hook 'hook-distutils.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
55816 INFO: Loading module hook 'hook-distutils.util.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
55816 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
55950 INFO: Loading module hook 'hook-heapq.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
55950 INFO: Loading module hook 'hook-lib2to3.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
56216 INFO: Loading module hook 'hook-matplotlib.backends.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
56216 INFO: Matplotlib backend selection method: automatic discovery of used backends
56816 INFO: Trying determine the default backend as first importable candidate from the list: ['Qt5Agg', 'Gtk3Agg', 'TkAgg', 'WxAgg']
59133 INFO: Selected matplotlib backends: ['TkAgg']
59184 INFO: Loading module hook 'hook-matplotlib.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
59786 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
59793 INFO: Loading module hook 'hook-numpy.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
59968 INFO: Import to be excluded not found: 'f2py'
59968 INFO: Loading module hook 'hook-numpy._pytesttester.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
59991 INFO: Loading module hook 'hook-packaging.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
59992 INFO: Loading module hook 'hook-pandas.io.formats.style.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
60817 INFO: Loading module hook 'hook-pandas.plotting.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
61048 INFO: Loading module hook 'hook-pandas.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63452 INFO: Loading module hook 'hook-pickle.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63457 INFO: Loading module hook 'hook-PIL.Image.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63949 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63957 INFO: Loading module hook 'hook-PIL.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63983 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
63991 INFO: Loading module hook 'hook-pkg_resources.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
65566 INFO: Processing pre-safe import module hook win32com from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\pre_safe_import_module\\hook-win32com.py'.
66583 WARNING: Hidden import "pkg_resources.py2_warn" not found!
66585 WARNING: Hidden import "pkg_resources.markers" not found!
66591 INFO: Loading module hook 'hook-pygments.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
69649 INFO: Loading module hook 'hook-pytz.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
70069 INFO: Loading module hook 'hook-setuptools.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73106 INFO: Loading module hook 'hook-sqlite3.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73247 INFO: Loading module hook 'hook-sysconfig.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73249 INFO: Loading module hook 'hook-wcwidth.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73269 INFO: Loading module hook 'hook-win32ctypes.core.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73822 INFO: Loading module hook 'hook-xml.dom.domreg.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73823 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73825 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
73826 INFO: Loading module hook 'hook-_tkinter.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
74083 INFO: checking Tree
74083 INFO: Building Tree because Tree-00.toc is non existent
74083 INFO: Building Tree Tree-00.toc
74284 INFO: checking Tree
74284 INFO: Building Tree because Tree-01.toc is non existent
74284 INFO: Building Tree Tree-01.toc
74447 INFO: checking Tree
74448 INFO: Building Tree because Tree-02.toc is non existent
74449 INFO: Building Tree Tree-02.toc
74453 INFO: Loading module hook 'hook-pythoncom.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
75138 INFO: Loading module hook 'hook-pywintypes.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
75780 INFO: Loading module hook 'hook-win32com.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'...
76348 INFO: Loading module hook 'hook-setuptools.msvc.py' from 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks'...
76482 INFO: Looking for ctypes DLLs
76544 WARNING: Library geos_c.dll required via ctypes not found
76583 INFO: Analyzing run-time hooks ...
76611 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_subprocess.py'
76614 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
76617 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_multiprocessing.py'
76617 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
76617 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgres.py'
76634 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32api.py'
76637 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_win32comgenpy.py'
76642 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_mplconfig.py'
76645 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_traitlets.py'
76647 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_osgeo.py'
76650 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\rthooks\\pyi_rth_pyproj.py'
76650 INFO: Including run-time hook 'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth__tkinter.py'
76706 INFO: Looking for dynamic libraries
c:\users\wd8322\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\building\build_main.py:156: UserWarning: The numpy.array_api submodule is still experimental. See NEP 47.
__import__(package)
c:\users\wd8322\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\isolated\_child.py:94: VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated in pyzmq 14.0 and will be removed.
Install tornado itself to use zmq with the tornado IOLoop.
while run_next_command(read_fh, write_fh):
84383 INFO: Looking for eggs
84383 INFO: Using Python library c:\users\wd8322\appdata\local\programs\python\python39\python39.dll
84394 INFO: Found binding redirects:
[]
84426 INFO: Warnings written to C:\Executable_Files\STC ATOLL Automation\build\STC_EXE\warn-STC_EXE.txt
84831 INFO: Graph cross-reference written to C:\Executable_Files\STC ATOLL Automation\build\STC_EXE\xref-STC_EXE.html
85017 INFO: checking PYZ
85017 INFO: Building PYZ because PYZ-00.toc is non existent
85023 INFO: Building PYZ (ZlibArchive) C:\Executable_Files\STC ATOLL Automation\build\STC_EXE\PYZ-00.pyz
87833 INFO: Building PYZ (ZlibArchive) C:\Executable_Files\STC ATOLL Automation\build\STC_EXE\PYZ-00.pyz completed successfully.
87908 INFO: checking PKG
87908 INFO: Building PKG because PKG-00.toc is non existent
87914 INFO: Building PKG (CArchive) STC_EXE.pkg
88516 WARNING: One binary added with two internal names.
88516 WARNING: ('spatialindex-64.dll',
'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\rtree\\lib\\spatialindex-64.dll',
'BINARY')
88516 WARNING: was placed previously at
88516 WARNING: ('rtree\\lib\\spatialindex-64.dll',
'c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\rtree\\lib\\spatialindex-64.dll',
'BINARY')
111283 INFO: Building PKG (CArchive) STC_EXE.pkg completed successfully.
111394 INFO: Bootloader c:\users\wd8322\appdata\local\programs\python\python39\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
111394 INFO: checking EXE
111394 INFO: Building EXE because EXE-00.toc is non existent
111394 INFO: Building EXE from EXE-00.toc
111399 INFO: Copying bootloader EXE to C:\Executable_Files\STC ATOLL Automation\dist\STC_EXE.exe.notanexecutable
111415 INFO: Copying icon to EXE
111416 INFO: Copying icons from ['c:\\users\\wd8322\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
111416 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
111416 INFO: Writing RT_ICON 1 resource with 3752 bytes
111416 INFO: Writing RT_ICON 2 resource with 2216 bytes
111416 INFO: Writing RT_ICON 3 resource with 1384 bytes
111416 INFO: Writing RT_ICON 4 resource with 37019 bytes
111416 INFO: Writing RT_ICON 5 resource with 9640 bytes
111416 INFO: Writing RT_ICON 6 resource with 4264 bytes
111416 INFO: Writing RT_ICON 7 resource with 1128 bytes
111431 INFO: Copying 0 resources to EXE
111433 INFO: Embedding manifest in EXE
111433 INFO: Updating manifest in C:\Executable_Files\STC ATOLL Automation\dist\STC_EXE.exe.notanexecutable
111433 INFO: Updating resource type 24 name 1 language 0
111433 INFO: Appending PKG archive to EXE
130649 INFO: Building EXE from EXE-00.toc completed successfully.