Python Forum

Full Version: Cannot Change Python script to exe using Pyinstaller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have done a code with python 3.5.4 version and I try to change the script to execution file using pyinstaller 3.5 and after changing the code to exe. this message appears
Quote:pkg_resources.DistributionNotFound: The 'Adafruit_IO' distribution was not found and is required by the application
I tried this piece of code in order to find Adafruit_IO in my script
def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
        try:
        # PyInstaller creates a temp folder and stores path in _MEIPASS
            base_path = sys._MEIPASS
        except Exception:
            base_path = os.path.abspath(".")

        return os.path.join(base_path, relative_path)
I point at the file location at site-packages still I get the same error any help would be appreciated
install adafruit-io (from command line)
pip3 install adafruit-io
Thank you, sir, but I have already done this step I have built a code that works as a script
read carefully https://pyinstaller.readthedocs.io/en/st...ation.html

there is nice example script that would help you to see what you should use
https://pyinstaller.readthedocs.io/en/st...sys-argv-0