Pyinstaller app created on mac and cant share with Windows Users - python

Hello I have currently make a .app that runs perfectly I have shared it with my friends that use mac and it runs perfectly It is a PyQt5 app that I created with pyinstaller the commands I used to make it is:
pyinstaller --icon=(.....).icns --onefile --noconsole -n(.....) (the .py script) It compiles perfectly and creates the app with the icon image and opens up and all that I am able to compress it into a zip file and email it to my mac users which also runs for them without them having to install anything
But I have some window user friends that I want to share with and the .app obviously wont work (I tried to change the file name and replaces the .app with .exe) and tried to send that which doesn't work they try and run it and it says
"this app can't run on your pc To Find a version for your pc check with the software publisher"
and so I tried to compile a new app but with -F in the pyinstaller thing added to the ling of code I use in the terminal then a bunch of stuff runs in the terminal that says .exe and all that and when I drag it onto my desktop it is a .app and so I change it to a .exe again and try and share it with my window user friends and I get the same error
"this app can't run on your pc To Find a version for your pc check with the software publisher"
Can anyone help me out im really trying to get a way on how to make it run on windows computer please!

To create a Windows app the script need to be compiled in a PC with Windows. The same for Mac and Linux. This is in the manual:
PyInstaller is tested against Windows, Mac OS X, and Linux. However, it is not a cross-compiler: to make a Windows app you run PyInstaller in Windows; to make a Linux app you run it in Linux, etc. PyInstaller has been used successfully with AIX, Solaris, and FreeBSD, but is not tested against them.

Related

How to run the .exe file in window exported from Mac machine

I am writing in Python and trying to export it as a .exe file from Mac machine. I tried to export it by auto-py-to-exe and it works well in my Mac machine. However, I found that it could not be opened in Window even I add the '.exe' after its file name. Is there any way to fix it or I can only export it in a Window machine? Thanks!
auto-py-to-exe seems to be a graphical interface for PyInstaller. According to the official PyInstaller docs
If you need to distribute your application for more than one OS, for example both Windows and Mac OS X, you must install PyInstaller on each platform and bundle your app separately on each.
You can do this from a single machine using virtualization. The free virtualBox or the paid VMWare and Parallels allow you to run another complete operating system as a “guest”. You set up a virtual machine for each “guest” OS. In it you install Python, the support packages your application needs, and PyInstaller.
So you would need to build it on a Windows or Windows VM to get it to work on Windows.

Can I create .exe file from python project If I am working on mac?

I am working on Mac iOS, but I need to make my whole project as .exe file, not .dmg. It is meant to be running on Windows, I would like to use pyinstaller but I faced some problems, wondering if working on Mac has to be the reason.
PyInstaller has can only target the OS it is running on: Source. However, you could use a VM running Windows to build a Windows executable, or use something like wine (Example here) to package it without a VM.

Pyinstaller on Kali to create exe for Windows XP

I am using Pyinstaller on Kali Linux 2 to create .exe to run on Windows XP.
So far, pyinstaller is successful at creating .exe that works on Kali Linux, but not Windows
Here is the python code
import webbrowser
webbrowser.open('http://www.cnn.com')
This is the command I ran on Kali Linux
~/Downloads/PyInstaller-3.2/pyinstaller.py --onefile --windowed --noupx open.py
When I open the resulting open.exe in Kali, it opens www.cnn.com. But if I email this attachment and open in Windows XP, it asks
When I save and try to execute, it says ..... How to troubleshoot this?
And when I click open is shows following. How to make it open with double-click?
From the PyInstaller documentation:
If you need to distribute your application for more than one OS, for example both Windows and Mac OS X, you must install PyInstaller on each platform and bundle your app separately on each.
So, to make an app which runs on Windows, you have to create it using PyInstaller on Windows.
Rafalmp is correct you must use a Windows machine to compile it. Alternatively you can use Wine, if you didn't have access to a Windows machine.
For more info please refer to Pyinstaller FAQ
Windows Defender assumes that externally sourced executables, especially those without cryptographic signature, may be malware. Try clicking "Open."

Pyinstaller guidance

I tried pyinstaller after reading few tutorials (in a hurry, though) and watching some video tuts. It beautifully made the dist folder which contains the executable file which runs on my ubuntu.
But when copied the same folder on windows 8 system, windows simply doesn't recognize it.
What I want is to make one single file for ubuntu, 1 for windows and 1 for mac such that users click on it and then a few nexts and then it gets installed on the system. A desktop icon should be created for it, just like normal softwares.
How can I do that?
You can't "cross-bundle" with Pyinstaller.
If you want to distribute your application on multiple operating systems, you must install pyinstaller and bundle your app separately on each, as explained on this page

How to run Python script on Ubuntu, Windows and MAC

I'm making Python software using wx GUI library but was wondering how to run this script on different OS's. For example, do I need to create executable installation file or bat file on Windows and sh file in Ubuntu?
I've got #!/usr/bin/env python at the top of the file and I can seem to run it by actually double clicking it and clicking it on "RUN" on prompt window but I would like it to be more professional as the users are not programmers.
Being used to run python scripts on both linux and Windows environments, I know that you can use the same script for both environments.
Keep using your shebang in Linux, it won't be procesed in windows (as it is actually a comment :).
Once Python is installed in Windows, you can actually simply double click on the script (it will run by default in a cmd window), run it using the cmd or launch it in idle.
If you want to develop python scripts on windows however, you'll need some more tools :).
If you want to be more professional (and prevent your users to modify the code :), you can still think about creating an exe file : http://www.lyxia.org/blog/developpement/python/creez-des-executables-46
(warning, french inside), by using pyinstaller http://www.pyinstaller.org/ . Works for windows and linux

Categories