I have a Python application built with PyQt5. My current OS is Windows 11 and I'm able to distribute my software to Windows users using PyInstaller and Inno Setup (to create the installer). However, I would like to distribute it to MacOS and Linux users too.
From PyInstaller's documentation:
PyInstaller is tested against Windows, Mac OS X, and GNU/Linux. However, it is not a cross-compiler: to make a Windows app you run PyInstaller in Windows; to make a GNU/Linux app you run it in GNU/Linux, etc. PyInstaller has been used successfully with AIX, Solaris, FreeBSD and OpenBSD but testing against them is not part of our continuous integration tests.
As you can see, PyInstaller is not cross-compiler. So, I'm wondering the best way to distribute my software to all OS using PyInstaller. Actually, I'm able to create .deb using WSL2, but no clues for .dmg for MacOS.
I've already read that I can use virtual machines to achieve this, but I would like some alternatives (maybe Docker?)
Thanks!
Related
I developed a Desktop Application in Python on my Mac using PyCharm.
Then I used pyinstaller to pack it and try to use it on Windows 10 and Windows 7 but when I try to run on windows 10 i have the error :
This app can’t run on your PC check with software publisher.
I tried to set every possible setting on windows 10, from SmartScreen to security policy to allow external developer. Nothing. So I thought could be something about pyinstaller.
Ideas?
PyInstaller is not cross platform.
See the documentation here., specifically the Note near the top of the page.
If you want to run on Windows, you must compile on Windows. Same for Mac OS and Linux.
Solutions to your particular problem:
Simply use a different machine to compile, with the relevant OS, if available.
A virtual machine on your Mac (VirtualBox for example) with Windows installed inside it.
As far as I know, there is no other way around this. No tricks or clever hacks... Sorry!
I am learning and developing an application using Windows 10, Eclipse + PyDev (Python 3.4.3).
This application is using 2 more Python libraries downloaded from PyPi repository.
Now my target system is a Linux environment with no internet connectivity.
I would like to install my code inside virtual environment in the system.
I learnt installing the Python libraries through tar.gz files from different sources.
But I am not sure how to package my code for Linux distribution from Windows, I don't see any proper options.
Below are my requests:
Steps for Packaging Linux distribution of my Python code from
Windows machine
Correct steps for creating Virtual Environment
activation and Freezing in case of upgrade of my code later (I dont
clear steps for this)
You don't need to do anything special to distribute your code for linux (unless you're using some platform-specific features).
You need to package your code properly, with a setup.py as detailed in the packaging projects tutorial.
I'm trying to build an application written in python, which can run on Windows without the need to install python or associated libraries(standalone), and I want to do that on my mac. I tried Pyinstaller, but it seems to generate files executable only in a platform that is building the application(in this case, osx).
Is there easy way out like Pyinstaller or do I have to do that in a very complex way? Since I'm not the expert, the latter option might be impossible for me to do. Would it be more wise just to try to build the app on windows than mac using pyinstaller?
For pyinstaller, they have clearly mentioned that packaging Windows binaries while running under OS X is NOT supported, and recommended to use Wine for this.
1. Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs
fine in Wine. You may also want to have a look at this thread in the
mailinglist. In version 1.4 we had build in some support for this, but
it showed to work only half. It would require some Windows system on
another partition and would only work for pure Python programs. As
soon as you want a decent GUI (gtk, qt, wx), you would need to install
Windows libraries anyhow. So it's much easier to just use Wine.
2. Can I package Windows binaries while running under OS X?
No, this is not supported. Please try Wine for this.
3. Can I package OS X binaries while running under Linux?
This is currently not possible at all. Sorry! If
you want to help out, you are very welcome.
I am new to python.I Have a python script for copying files from local machine to sftp location.The script will use the wxpython,pycrypto and ssh modules of python.I created an exe file by using the pyinstaller.My machine is windows 7 64-bit.I used pyinstaller 2.1 and python 2.7.6.amd 64 for creating the exe file.It's working fine in windows 7 64-bit.But it's not working in xp,win7 32-bit.In linux i used wine for executing this exe but there also it's not working.
Then i created one more exe in windows7 32-bit machine.this exe is working fine in win7 32 and 64 bit versions.but it's not working in xp.
Can anyone tell me what cpuld be the reason and how to resolve it.
I want one installer which can be installed in windows or linux.
Thanks in advance.
Well according to github pyinstaller site there is a version for each system. Try downloading and installing it on windows XP, I suppose it will work everywhere then :P
Except linux ofcourse, I don't know about that, but I suppose pyinstaller will create installation package for you (something that you install with pythonXXX setup.py install). If you are more into designing your package yourself then there is great (but hard as hell) tutorial.
What you have to do is build this aplication of yours on whatever system you wish to distribute it, and hold a version for each of those systems separately (there's a reason why everybody does that :P)
I know that this question is a bit old, but perhaps someone will contribute from this answer ^.^
Pyinstaller does not allow cross compilation. so if you want to have an executable file you should compile your project first in Linux OS and then you may use wine in which you can compile the project to have the windows executable
I'm wondering how I can create a 32-bit binary with my 64bit cx_freeze. I've looked at the homepage and I can't find a setting to tell it what architecture to build for.
I'm running 32bit(otherwise PyQt won't work) Python 2.6, so the dependencies should already be 32bit, on 64bit Kubuntu 10.10.
If you were using Windows or a Mac, then you could use py2exe or py2app, respectively. I think that freeze may be a more general solution that may work for you.
Maybe this link will help you: http://linux.die.net/man/8/linux32
Otherwise you can create a x32 virtual machine by using QEmu or VirtualBox...
I have a pyqt project for which I used to distribute frozen apps before just releasing it open source, for win/linux/osx.
I used the following:
Pyinstaller for linux
Py2app for osx
Py2exe for windows
http://www.pyinstaller.org/