Python Forum
Cannot Change Python script to exe using Pyinstaller
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot Change Python script to exe using Pyinstaller
#1
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
Reply
#2
install adafruit-io (from command line)
pip3 install adafruit-io
Reply
#3
Thank you, sir, but I have already done this step I have built a code that works as a script
Reply
#4
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,008 Jun-29-2023, 11:57 AM
Last Post: gologica
  Make console show after script was built with Pyinstaller --NOCONSOLE? H84Gabor 0 1,189 May-05-2022, 12:32 PM
Last Post: H84Gabor
  Pyinstaller 3 Python 2 mckymntl 0 1,206 Feb-07-2022, 06:28 AM
Last Post: mckymntl
  Python 3.7, Windows 10, pyinstaller, winsound, no sound in executable kmarien 3 3,588 Nov-30-2020, 04:10 PM
Last Post: buran
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,790 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,248 May-28-2020, 05:27 PM
Last Post: micseydel
  Change mouse move speed in guibot script rulltartan 1 2,691 Mar-30-2020, 01:51 PM
Last Post: pevogam
  Pyinstaller with Sys.Argv[] - “Failed to Execute Script”? ironfelix717 0 5,257 Aug-07-2019, 02:29 PM
Last Post: ironfelix717
  Help with PyInstaller + Script "Failed to Execute Script" ironfelix717 2 9,514 Jul-31-2019, 02:18 PM
Last Post: ironfelix717
  How to really change dir in a script ? Usjes 1 1,997 May-25-2019, 09:36 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020