Windows kivy app successfully builds using PyInstaller, but doesn't work - python

I tried to create an executable file in Windows from a kivy project with PyInstaller, and even though it appears to have been successfully created, when I try to run it, I get this
What could cause this? I'm relatively new to kivy, and any help will be much appreciated

well, I actually figured it out myself. Though I don't think that my solution is in any way elegant and it might cause some other problems in the future, but i just edited the pyi_rth_pkgutil.py from PyInstaller package directory (how it is now, how it used to be) and reran the pyinstaller package creation script. It just worked after that

Related

Run a . exe file genarated using pyinstaller outside my venv is not working

I converted a xxxx.py to a yyyy.exe using pyinstaller, after a lot of modifications, and googling I managed to make the yyyy.exe work inside my venv, but when I switched outside venv(base), the yyyy.exe did not work, it seems that when yyyy.exe is executed,it still looking to import libraries from site packages in my local machine insted of looking inside dist folder where all needed libararies are installed. I do care about this issue since I m going to share only my file.exe with collegues not (file.exe and the venv) And it should work for them.
Any help is really appreciated.
I think your program has a dependency problem.
You have to install(build dependency tree) the .exe file before running.
You have to build an installer for it.
See:
Inno setup
for a good package creator.
here is a good tutorial:in youtube
Note, there are many good options for this work, feel free to check out them.

Am I forgetting something?

Recently I have written a simple software in python and now I would like to share it with some people, but the problem is that they don't use python on their computer. Because of that an executable program could help me a lot and I tried to do it by using the package Pyinstaller with the following syntax:
pyinstaller --onefile -w program.py
After doing that three new folders was created and I found the executable file inside the dist folder but it doesn't work. When I clicked twice a error message showed up
Error message
Could anyone please tell why it happens and how I can work around this situation ? And also if you have another idea about how to convert .py to .exe besides using the Pyinstaller it would help me so much as well. I'm using python 3.8
Thanks
What error does it give you?
I haven't used Pyinstaller, but I've had success with auto-pye-to-exe as an alternative.
PyInstaller does not compile Python code into binary code. It just bundles your code into one installable exe file. So it does not improve the performance or code privacy.
Better option is to use CXFreeze or Nuitka. I personally prefer to use Nuitka because it worked in most cases where CXFreeze could not deal with.
Simply install Nuitka using pip or conda command. The documentation itself is quite good to start with.

Import error when executing standalone exe created with nuitka

I am trying to create a standalone exe from python code using nuitka. Its a rather sizable program with several libraries including for instance PyQt5.
I have created the exe using:python -m nuitka --standalone --follow-imports --enable-plugin=qt-plugins --enable-plugin=numpy --python-flag=no_site --mingw64 rs_main.py
I have also tried without the --mingw64 and --python-flag=no_site flags but they all give me the same error when I try to execute the resulting exe:
ImportError: LoadLibraryEx 'D:\... ...\rs_main.dist\PyQt5\QtWidgets.pyd' failed: The specified procedure could not be found.
I checked and the file does exist in the correct location.
The compiling itself gives me some warnings but no errors.
Online I found my problem here: https://github.com/Nuitka/Nuitka/issues/73 but to be honest I do not fully understand their journey towards the solution and as I think I understand it should be solved in my version of nuitka which is 0.6.6. On top of that I am running python 3.7.3 on a windows 10 machine.
Hopefully someone can explain me the solution in the referenced link or offer one of their own. thanks in advance.
So this is not really an answer to my question, but if anyone comes across this question, maybe my solution is good enough for them as well.
So although I know it does not do the same as Nuitka I was finally able to create a standalone exe using pyinstaller including some flags such as --hidden-imports and add the path to Qt but I found the feedback of pyinstaller to be rather understandable.
So maybe if you have the same problem as me, this might be a different approach for you as well.

Using pyinstaller to try and make a standalone exe to produce a tkinter window, but the generated exe isn't making any window; what am I missing?

Good evening, noble experts. I'm likely going to betray some of my ignorance again!
I've written a python script that creates a window in tkinter, and works the way I'd like it to so far as I can tell. What I'd like to do now is turn it into a standalone .exe that will, upon being double-clicked, generate said window for use.
I've installed pyinstaller, and put in the fateful commands to create the .exe from my humble .py
.../python pyinstaller.py -w -F examplename.py
and shiny new .exe was made and put into the /dist folder. The problem I seem to be encountering, is that running this application doesn't open up the tkinter window in the script, and I'm not sure why. Based on the tutorials I've seen online and my own limited understanding of the process, I suspect that it may have something to do with a SPEC file, which I have not yet fiddled with as I'm not 100% certain that is what's causing this issue.
I would greatly appreciate any insight into this, and if I've neglected key information that you need, I will try and fill that in asap. Thank you!
Edit: so it turns out that one of the modules that I was using in this, (scipy), has some known issues with pyinstaller. When I commented out the scipy stuff, it worked the way it was supposed to... minus the scipy of course. I'm going to have to spend some time figuring out/understanding the workaround for it.

PyInstaller and Enthought Suite

I was wondering if anyone has any success in creating a stand alone executable using pyinstaller with a script that has enthought imports. I have been trying to do this for a couple of days now, however I keep getting an import error. Through some digging around I believe that I might need to add some hidden import and create my own hooks. However I have not heard of anyone having any success with this, so I thought I would ask here and see if anyone might have some experience with this situation.
I had been trying to build a stand alone exe of my python app which uses matplotlib (one of the components of enthought) and was having lots of trouble getting it to work. Finally found a bug post (http://www.pyinstaller.org/ticket/651) on pyinstaller site that told me that it was a bug in pyinstaller. I followed the reference in that post to download the fixed version of pyinstaller at ​https://github.com/pyinstaller/pyinstaller/pull/61
Now my build to stand alone exe works fine. I bet you were experiencing the same problem as me. see... Building python pylab/matplotlib exe using pyinstaller

Categories

Resources