1

I want to build a standalone executable application from my python script(s) so that other users can run it without having to install Python and it's packages.

I used pyinstaller --onefile GUI.py to try this out since it seemed easy enough. However, I ended up with these errors in the warn-GUI.txt file (The command actually built the .exe but when I double clicked it, it immediately crashed and closed the command prompt).

THINGS I'VE TRIED:

  • I've tried editing the .spec file to include the pandas, numpy, pystdf, and multiprocessing modules that are "missing" to the hiddenimports=[] list.
  • I've tried adding all the imports from all secondary calls/scripts to the main.py file (GUI.py)
  • I've removed all unnecessary imports and removed any imports that were from module_name import * format
  • I've tried pyinstaller --onefile --windowed GUI.py
  • I am not using a virtual env
  • I even tried doing this on a much simpler script with only a few modules/packages imported (a tkinter window that says "hello world" on a button click). I thought pyinstaller wasn't compatible with my version of Python, but this hello_world application worked perfectly as a .exe

VERSIONS:

  • PyInstaller: 3.6
  • Python: 3.8.5
  • Platform: Windows-10-10.0.18362-SP0

IMPORTS in my main:

import ctypes
import logging
import threading
import webbrowser
import pandas as pd
import tkinter as tk
import log_dict as ld
import logging.config
from GUIfuncitons import ProcessFiles, ExportFiles, CreateToolTip
from tkinter import filedialog as fd
from tkinter import messagebox as mb
from tkinter.ttk import Frame, Label, Entry, Notebook
from tkinter.ttk import Scrollbar, Radiobutton, Button, Progressbar

MISSING MODULES:

IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
           yourself tracking down the missing module. Thanks!

missing module named _posixsubprocess - imported by subprocess (optional), multiprocessing.util (delayed)
missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level), PyInstaller.loader.pyimod02_archive (delayed, conditional)
missing module named urllib.pathname2url - imported by urllib (conditional), PyInstaller.lib.modulegraph._compat (conditional)
missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed), distutils.archive_util (optional)
missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), pathlib (delayed, conditional, optional), http.server (delayed, optional), webbrowser (delayed), netrc (delayed, conditional), getpass (delayed), distutils.util (delayed, conditional, optional), distutils.archive_util (optional)
missing module named posix - imported by os (conditional, optional), shutil (conditional)
missing module named resource - imported by posix (top-level), test.support (optional)
missing module named pyimod03_importers - imported by PyInstaller.loader.pyimod02_archive (delayed, conditional), C:\Users\a0233763\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py (top-level)
missing module named 'com.sun' - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional)
missing module named com - imported by pkg_resources._vendor.appdirs (delayed)
missing module named win32api - imported by distutils.msvccompiler (optional), pkg_resources._vendor.appdirs (delayed, conditional, optional)
missing module named win32com.shell - imported by pkg_resources._vendor.appdirs (delayed, conditional, optional)
missing module named _winreg - imported by platform (delayed, optional), pkg_resources._vendor.appdirs (delayed, conditional)
missing module named _uuid - imported by uuid (optional)
missing module named netbios - imported by uuid (delayed)
missing module named win32wnet - imported by uuid (delayed)
missing module named termios - imported by tty (top-level), getpass (optional)
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional)
missing module named __builtin__ - imported by pkg_resources._vendor.pyparsing (conditional), setuptools._vendor.pyparsing (conditional)
missing module named ordereddict - imported by pkg_resources._vendor.pyparsing (optional), setuptools._vendor.pyparsing (optional)
missing module named StringIO - imported by PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), setuptools._vendor.six (conditional), six (conditional), pkg_resources._vendor.six (conditional)
missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.markers (top-level), pkg_resources._vendor.packaging.requirements (top-level)
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
missing module named org - imported by pickle (optional)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named win32evtlog - imported by logging.handlers (delayed, optional)
missing module named win32evtlogutil - imported by logging.handlers (delayed, optional)
missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern (top-level), pkg_resources (top-level)
missing module named 'pkg_resources.extern.six.moves' - imported by pkg_resources (top-level), pkg_resources._vendor.packaging.requirements (top-level)
missing module named pkg_resources.extern.six - imported by pkg_resources.extern (top-level), pkg_resources (top-level), pkg_resources.py31compat (top-level)
missing module named vms_lib - imported by platform (delayed, conditional, optional)
missing module named java - imported by platform (delayed)
missing module named 'multiprocessing.forking' - imported by C:\Users\a0233763\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_multiprocessing.py (optional)
missing module named pystdf - imported by parse_func (top-level)
missing module named requests - imported by api_v3 (top-level)
missing module named setuptools.extern.packaging - imported by setuptools.extern (top-level), setuptools.dist (top-level), setuptools.command.egg_info (top-level)
missing module named 'setuptools.extern.six' - imported by setuptools (top-level), setuptools.extension (top-level)
missing module named 'setuptools.extern.packaging.specifiers' - imported by setuptools.config (top-level)
missing module named 'setuptools.extern.packaging.version' - imported by setuptools.config (top-level), setuptools.msvc (top-level)
missing module named setuptools.extern.six.moves.filterfalse - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.msvc (top-level)
missing module named setuptools.extern.six.moves.filter - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.ssl_support (top-level), setuptools.command.py36compat (top-level)
missing module named setuptools.extern.ordered_set - imported by setuptools.extern (top-level), setuptools.dist (top-level), setuptools.command.sdist (top-level)
missing module named 'setuptools.extern.packaging.utils' - imported by setuptools.wheel (top-level)
missing module named 'setuptools.extern.packaging.tags' - imported by setuptools.wheel (top-level)
missing module named wincertstore - imported by setuptools.ssl_support (delayed, optional)
missing module named 'backports.ssl_match_hostname' - imported by setuptools.ssl_support (optional)
missing module named backports - imported by setuptools.ssl_support (optional)
missing module named 'setuptools._vendor.six.moves' - imported by 'setuptools._vendor.six.moves' (top-level)
missing module named _manylinux - imported by setuptools._vendor.packaging.tags (delayed, optional)
missing module named 'setuptools.extern.pyparsing' - imported by setuptools._vendor.packaging.markers (top-level), setuptools._vendor.packaging.requirements (top-level)
missing module named setuptools.extern.six.moves.map - imported by setuptools.extern.six.moves (top-level), setuptools.dist (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.command.egg_info (top-level), setuptools.namespaces (top-level)
runtime module named setuptools.extern.six.moves - imported by setuptools.dist (top-level), configparser (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.command.setopt (top-level), setuptools.package_index (top-level), setuptools.ssl_support (top-level), setuptools.py33compat (top-level), setuptools.command.egg_info (top-level), setuptools.command.py36compat (top-level), setuptools.namespaces (top-level), setuptools.msvc (top-level), 'setuptools._vendor.six.moves' (top-level)
missing module named setuptools.extern.six - imported by setuptools.extern (top-level), setuptools.monkey (top-level), setuptools.dist (top-level), setuptools.extern.six.moves (top-level), setuptools.config (top-level), setuptools.command.easy_install (top-level), setuptools.sandbox (top-level), setuptools.py27compat (top-level), setuptools.package_index (top-level), setuptools.py33compat (top-level), setuptools.wheel (top-level), setuptools.command.egg_info (top-level), setuptools.command.sdist (top-level), setuptools.command.bdist_egg (top-level), setuptools.unicode_utils (top-level), setuptools.installer (top-level), setuptools.command.develop (top-level)
missing module named 'numpy_distutils.cpuinfo' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named 'numpy_distutils.fcompiler' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named 'numpy_distutils.command' - imported by numpy.f2py.diagnose (delayed, conditional, optional)
missing module named numpy_distutils - imported by numpy.f2py.diagnose (delayed, optional)
missing module named __svn_version__ - imported by numpy.f2py.__version__ (optional)
missing module named numarray - imported by numpy.distutils.system_info (delayed, conditional, optional)
missing module named Numeric - imported by numpy.distutils.system_info (delayed, conditional, optional)
missing module named win32con - imported by distutils.msvccompiler (optional)
missing module named _curses - imported by curses (top-level), curses.has_key (top-level)
missing module named _dummy_threading - imported by dummy_threading (optional)
missing module named pytest - imported by numpy._pytesttester (delayed), numpy.testing._private.utils (delayed), pandas._testing (delayed, conditional, optional), pandas.util._tester (delayed, optional)
missing module named 'nose.plugins' - imported by numpy.testing._private.noseclasses (top-level), numpy.testing._private.nosetester (delayed)
missing module named scipy - imported by numpy.testing._private.nosetester (delayed, conditional), pandas.core.missing (delayed)
missing module named 'nose.util' - imported by numpy.testing._private.noseclasses (top-level)
missing module named nose - imported by numpy.testing._private.utils (delayed, optional), numpy.testing._private.decorators (delayed), numpy.testing._private.noseclasses (top-level)
missing module named psutil - imported by numpy.testing._private.utils (delayed, optional)
missing module named numpy.core.number - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named numpy.core.object_ - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.signbit - imported by numpy.core (delayed), numpy.testing._private.utils (delayed)
missing module named win32pdh - imported by numpy.testing._private.utils (delayed, conditional)
missing module named numpy.core.isnan - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.testing._private.utils (delayed)
missing module named numpy.core.float32 - imported by numpy.core (top-level), numpy.testing._private.utils (top-level)
missing module named numpy.core.intp - imported by numpy.core (top-level), numpy.testing._private.utils (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.lib.i0 - imported by numpy.lib (top-level), numpy.dual (top-level)
missing module named numpy.linalg.matrix_power - imported by numpy.linalg (top-level), numpy.matrixlib.defmatrix (top-level)
missing module named numpy.random.randn - imported by numpy.random (top-level), pandas._testing (top-level)
missing module named numpy.random.rand - imported by numpy.random (top-level), pandas._testing (top-level)
missing module named numpy.core.integer - imported by numpy.core (top-level), numpy.fft.helper (top-level)
missing module named numpy.core.sqrt - imported by numpy.core (top-level), numpy.linalg.linalg (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.conjugate - imported by numpy.core (top-level), numpy.fft._pocketfft (top-level)
missing module named numpy.core.sign - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.divide - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.geterrobj - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.add - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.complexfloating - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.inexact - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.cdouble - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.csingle - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.double - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.core.single - imported by numpy.core (top-level), numpy.linalg.linalg (top-level)
missing module named numpy.linalg.inv - imported by numpy.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.linalg.lstsq - imported by numpy.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named numpy.linalg.eigvals - imported by numpy.linalg (top-level), numpy.lib.polynomial (top-level)
missing module named pickle5 - imported by numpy.compat.py3k (optional)
missing module named numpy.recarray - imported by numpy (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.dtype - imported by numpy (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level)
missing module named numpy.expand_dims - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.array - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level)
missing module named numpy.bool_ - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.mrecords (top-level)
missing module named numpy.iscomplexobj - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amin - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.amax - imported by numpy (top-level), numpy.ma.core (top-level)
missing module named numpy.ndarray - imported by numpy (top-level), numpy.ma.core (top-level), numpy.ma.extras (top-level), numpy.ma.mrecords (top-level), numpy.ctypeslib (top-level), pandas.compat.numpy.function (top-level)
missing module named numpy.histogramdd - imported by numpy (delayed), numpy.lib.twodim_base (delayed)
missing module named numpy.eye - imported by numpy (delayed), numpy.core.numeric (delayed)
missing module named numexpr - imported by pandas.core.computation.expressions (conditional), pandas.core.computation.engines (delayed)
missing module named 'matplotlib.pyplot' - imported by pandas.plotting._matplotlib.style (delayed), pandas.plotting._matplotlib.tools (delayed), pandas.plotting._matplotlib.core (delayed), pandas.plotting._matplotlib.boxplot (delayed), pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed), pandas.plotting._matplotlib (delayed), pandas.io.formats.style (optional), pandas._testing (delayed)
missing module named 'fsspec.core' - imported by pandas.io.parquet (delayed, conditional)
missing module named fsspec - imported by pandas.io.parquet (delayed, conditional)
missing module named pyarrow - imported by pandas.core.dtypes.dtypes (delayed, conditional), pandas.core.arrays.period (delayed), pandas.core.arrays._arrow_utils (top-level), pandas.core.arrays.masked (delayed), pandas.core.arrays.integer (delayed, conditional), pandas.core.arrays.string_ (delayed, conditional), pandas.core.arrays.interval (delayed), pandas.io.feather_format (delayed), pandas.core.arrays.boolean (delayed, conditional), pandas.io.orc (delayed)
missing module named 'pyarrow.parquet' - imported by pandas.io.parquet (delayed)
missing module named six.moves.range - imported by six.moves (top-level), dateutil.rrule (top-level)
runtime module named six.moves - imported by dateutil.tz.tz (top-level), dateutil.tz._factories (top-level), dateutil.tz.win (top-level), dateutil.rrule (top-level)
missing module named dateutil.tz.tzfile - imported by dateutil.tz (top-level), dateutil.zoneinfo (top-level)
missing module named AppKit - imported by pandas.io.clipboard (delayed, conditional, optional)
missing module named Foundation - imported by pandas.io.clipboard (delayed, conditional, optional)
missing module named PyQt4 - imported by pandas.io.clipboard (delayed, conditional, optional)
missing module named PyQt5 - imported by pandas.io.clipboard (delayed, conditional, optional)
missing module named qtpy - imported by pandas.io.clipboard (delayed, conditional, optional)
missing module named 'sqlalchemy.types' - imported by pandas.io.sql (delayed, conditional)
missing module named 'sqlalchemy.schema' - imported by pandas.io.sql (delayed, conditional)
missing module named sqlalchemy - imported by pandas.io.sql (delayed, conditional, optional)
missing module named tables - imported by pandas.io.pytables (delayed, conditional)
missing module named xlwt - imported by pandas.io.excel._xlwt (delayed)
missing module named xlsxwriter - imported by pandas.io.excel._xlsxwriter (delayed)
missing module named 'openpyxl.styles' - imported by pandas.io.excel._openpyxl (delayed)
missing module named 'openpyxl.style' - imported by pandas.io.excel._openpyxl (delayed)
missing module named openpyxl - imported by pandas.io.excel._openpyxl (delayed, conditional)
missing module named 'odf.config' - imported by pandas.io.excel._odswriter (delayed)
missing module named 'odf.style' - imported by pandas.io.excel._odswriter (delayed)
missing module named 'odf.text' - imported by pandas.io.excel._odfreader (delayed), pandas.io.excel._odswriter (delayed)
missing module named 'odf.table' - imported by pandas.io.excel._odfreader (delayed), pandas.io.excel._odswriter (delayed)
missing module named 'odf.opendocument' - imported by pandas.io.excel._odfreader (delayed), pandas.io.excel._odswriter (delayed)
missing module named pyxlsb - imported by pandas.io.excel._pyxlsb (delayed)
missing module named xlrd - imported by pandas.io.excel._xlrd (delayed)
missing module named 'odf.element' - imported by pandas.io.excel._odfreader (delayed)
missing module named 'odf.namespaces' - imported by pandas.io.excel._odfreader (delayed)
missing module named odf - imported by pandas.io.excel._odfreader (delayed)
missing module named matplotlib - imported by pandas.plotting._matplotlib.boxplot (top-level), pandas.plotting._matplotlib.compat (delayed, optional), pandas.plotting._matplotlib.timeseries (delayed), pandas.plotting._matplotlib.core (delayed), pandas.io.formats.style (optional)
missing module named 'scipy.signal' - imported by pandas.core.window.rolling (delayed, conditional)
missing module named 'matplotlib.ticker' - imported by pandas.plotting._matplotlib.converter (top-level), pandas.plotting._matplotlib.tools (top-level), pandas.plotting._matplotlib.core (delayed)
missing module named 'matplotlib.table' - imported by pandas.plotting._matplotlib.tools (top-level)
missing module named 'scipy.stats' - imported by pandas.core.nanops (delayed, conditional), pandas.plotting._matplotlib.hist (delayed), pandas.plotting._matplotlib.misc (delayed, conditional)
missing module named 'matplotlib.colors' - imported by pandas.plotting._matplotlib.style (top-level), pandas.plotting._matplotlib.core (delayed)
missing module named 'matplotlib.cm' - imported by pandas.plotting._matplotlib.style (top-level)
missing module named 'matplotlib.patches' - imported by pandas.plotting._matplotlib.misc (top-level)
missing module named 'matplotlib.lines' - imported by pandas.plotting._matplotlib.misc (top-level)
missing module named 'matplotlib.axes' - imported by pandas.plotting._matplotlib.core (delayed)
missing module named 'matplotlib.artist' - imported by pandas.plotting._matplotlib.core (top-level)
missing module named 'matplotlib.units' - imported by pandas.plotting._matplotlib.converter (top-level)
missing module named 'matplotlib.transforms' - imported by pandas.plotting._matplotlib.converter (top-level)
missing module named 'matplotlib.dates' - imported by pandas.plotting._matplotlib.converter (top-level)
missing module named 'IPython.core' - imported by pandas.io.formats.printing (delayed, conditional)
missing module named IPython - imported by pandas.io.formats.printing (delayed)
missing module named s3fs - imported by pandas.io.common (delayed, optional)
missing module named botocore - imported by pandas.io.common (delayed, conditional, optional)
missing module named sets - imported by pytz.tzinfo (optional)
missing module named UserDict - imported by pytz.lazy (optional)
missing module named 'scipy.sparse' - imported by pandas.core.arrays.sparse.scipy_sparse (delayed), pandas.core.arrays.sparse.accessor (delayed), pandas.core.dtypes.common (delayed, conditional, optional)
missing module named hypothesis - imported by pandas.util._tester (delayed, optional)
missing module named 'pyarrow.orc' - imported by pandas.io.orc (delayed)
missing module named 'lxml.etree' - imported by pandas.io.html (delayed)
missing module named lxml - imported by pandas.io.html (delayed)
missing module named bs4 - imported by pandas.io.html (delayed)

ERRORS:

These are error that popup on a the console when I double click the .exe file after it's built:

Error in console

I'm really new to Python and I've looked all over Stack Overflow and tried each suggestion for pyinstaller, but nothing took. Any help is greatly appreciated!

VanessaH9
  • 13
  • 1
  • 1
  • 4
  • "_I've tried `pyinstaller --onefile --windowed GUI.py`_ " if u tried dis out, wat error does it show in d console?+ i hope u have moved the file from dist folder onto youre main file directory – Delrius Euphoria Jul 28 '20 at 20:23
  • @CoolCloud when i ran the `pyinstaller --onefile --windowed GUI.py`, the .exe in the dist folder crashes the same and the modules error still are displayed in the warn-GUI.txt file. I also tried moving the file from dist to the directory where my main is and same error occurs. – VanessaH9 Jul 28 '20 at 20:33
  • i see, what abt the console that shows up? what does it show in dat? thats what matter i guess – Delrius Euphoria Jul 28 '20 at 20:38
  • sorry, my bad wat i meant is `pyinstaller --onefile -c GUI.py` giv this a try – Delrius Euphoria Jul 28 '20 at 20:50
  • so when i double click on the executable when i ran `pyinstaller --onefile -c GUI.py` i have to rapidly screen capture the console that pops up. Essentially the error is a traceback error that is a `ModuleNotFoundError: module no module named 'pandas'` – VanessaH9 Jul 28 '20 at 20:56
  • only one line of error? – Delrius Euphoria Jul 28 '20 at 20:57
  • are you using a virtual env ? cause it says pandas is not installed in d env that u r using – Delrius Euphoria Jul 28 '20 at 21:04
  • No it's a traceback. I ended up fixing the pandas just now by re-installing it but now another module is not found. The error is the same and is as follows: `File: C:\...._pkgres.py, line 13 in import pkg_resources as res File C:\...., line 623, in exec_module exec(bytecode, module.__dict__) File site-packages\pkg_resources\__init__.py, line 86, in ModuleNotFoundError: No module named 'pkg_resources.py2_warn` – VanessaH9 Jul 28 '20 at 21:06
  • I am not using a virtual env. – VanessaH9 Jul 28 '20 at 21:07
  • its supposed to be working :( i guess im missing something here , anyways add those errors to the Q and may have to wait for some1 experienced to help – Delrius Euphoria Jul 28 '20 at 21:09
  • 1
    it's okay lol. thanks for your help anyway! – VanessaH9 Jul 28 '20 at 21:13

1 Answers1

4

Did you try to add the --paths= option to your pyinstaller command ?

It adds paths to search into in the building process.

For example, when working with Pycharm, something like

pyinstaller --onefile --paths=[myLocalDir]/PycharmProjects/[myProject]/venv/Lib/site-packages [myScriptToMakeStandalone.py]
Ruli
  • 2,592
  • 12
  • 30
  • 40
Dany
  • 71
  • 5
  • 1
    This worked for me! I had to specify the directory of my custom module in the --paths option, for some reason. I would have thought pyinstaller would have used the directory where I ran it as a directory in the path, but apparently not in my instance. – pythko Oct 11 '22 at 16:06