I made GUI application with PyQt and wrapped it up with pyinstaller.
As you know, make it for onefile (sole exe file) is quite slow.
So, what I want to do is wrap it by using pyinstaller but not in onefile, but i still don't want to execute the exe file in the folder. I want to move the exe file to desktop directory so I can use it like onefile. I tried it but it says there is no .dll on desktop directory.
I assume that there is quite simple solution.
How can I solve this problem?
Keep the file in the folder and create a shortcut on the desktop instead. You can have also shortcuts in the Start menu for example or pin the exe (create shortcut) in TaskBar. If you are going to distribute it a simple installer can automate the creation of the said shortcuts.
Related
As the title says.
I have used pyinstaller to create my app from the python source code and it works perfectly. I would like to get the app to appear in the start menu but I don't know how to do this?
I have no experience with pyinstaller, but it looks like it's main function is to package Python code into an executable.
What you are looking for is an installation packager which packs all your files and configs into installations package (eg. msi). This package unpacks on the destination system into specified locations and creates all those icons in the start menu and on the desktop and etc.
Take a look at this question: How can I create an MSI setup?
Once your app is installed in the Program Files folder, add a new folder in
C:\ProgramData\Microsoft\Windows\Start Menu\
Then add a shortcut, .ink, in that folder to the .exe file in Program Files.
Your program will then show up in the start menu.
Here's what I have done so far:
-I made a desktop search program/GUI using python and tkinter.
-Then I used py2exe to convert it to an exe.
-Now the software perfectly works on a machine(windows) without python installed, but the problem is that a creepy black window just appears along with the GUI when the .exe is opened.
Is there any way to make it look less creepy to an end user?
Change the file extension from .py to .pyw
(You must have Python installed for this to work.)
Duplicate:
Hide console window with Tkinter and cx_Freeze
Before converting your file to an exe, change the file extension (by renaming the file) from .py to .pyw.
'.py' files open with the console, whereas '.pyw' files open with no console window.
I am trying to use PyInstaller for generating an .Exe from a Python 2.7 file. In the CMD window, I run pyinstaller myfile.py.
It creates a build and dist folder both of which have a number of files, including an Application file. When I click both application files, a CMD box pops up and very quickly disappears, despite my file requiring inputs from the user.
What I am missing here? Which file can I distribute to be a usable copy?
By default, PyInstaller generates a one-folder bundle containing an executable, it also creates this executable with a console window for standard input/output. I'm just guessing, but your script don't have a GUI, right?
In any case, the better way to work is creating a one-file bundle:
pyinstaller -F myfile.py
In this way, you only have to execute one file.
if after executing the application, it behaves in the same way, I would say that adding the -d option will help you to find out what is going wrong with your generated executable. Also, running your application from a per-existing CMD window is recommendable since these windows do not close itself after running your application.
I have written a python script with a Tkinter GUI. I would like to create a desktop icon that will execute this script so that the end-user (not myself) will be able to double-click the icon and have the GUI load, rather than 'run' the script from the terminal or python shell and then have to F5 from there.
Is there a way to do this? I have googled many arrangements of my question but most answers seem to be normal python scripts, not ones which are Tkinter based.
I am using a Raspberry Pi with Wheezy and Python 2.7
Thanks in advance.
I create executables(icons that I click to start the programs I write) using 'py2exe'. I use windows 7 and I am not sure if it would work for you with Raspberry Pi, but a google search may clear that up for you. I will provide the link below. Basically you end up with a folder with the executable(icon) and also some files, without which the executable won't work. It's unfortunate that you get this extra 'baggage', but it's still handy and the best solution I have come across. I don't think there is a much better way, but I am not 100% on that. Interestingly, I found that you could delete most of these baggage files and the executable would still work, it was trial and error, but it didn't take long. If I want to send the folder to someone, I zip it first.
py2exe is here
If you need a 64 bit binary you can get it here, along with, actually, pretty much every other version. get py2exe here also
Besides creating executable file other option is create simple .bat file:
Open notepad
Enter "C:\ProgramData\Anaconda3\python.exe" "C:\Users\Your ID\script.py"
First part is path to python.exe, second to your python script
save file as .bat file, ex. "open_program.bat"
Now simply double click on saved .bat file icon should open your script.
I like using cx-freeze to convert python scripts to exe.
There is very easy to follow documentation to do this. In short, you create a setup.py script that specifies what libraries and packages you want to include or exclude in your application.
You can then run the build in the console and it will create a build folder, in which will be an Application File. You can create a Desktop short cut using send to and selecting desktop.
Documentation link
You can save the script as a .pyw file so the user can click on the file and the GUi would open
I just checked the wiki and realized you need to input a tonne of code to change a python file containing pygame code to an exe. Is there not an easier way? Shouldn't it just be an exe file that you just open and imput what you want to change and where to save the exe to?
I am not sure I completely understand your question, but I would recommend using PyInstaller. All you have to do it go into the pyinstaller directory, and then run:
python pyinstaller.py /link/to/your/program
which should then make a directory in the pyinstaller directory named after your .py file. In that file you will have a build folder and a dist folder. The dist is the one of interest and will have your .exe in it.