Distributing python modules for another architecture - python

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/

Related

Using Docker and Pyinstaller to distribute my application

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!

Building an executable application for windows .exe on mac

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.

What is a good way to package gtk python applications for windows xp?

I'm trying to package a python 3.4 application that uses Gtk bindings for windows xp 32bit.
I installed windows xp sp3 32bit onto a virtual machine and installed the required dependencies, after fixing some linux specific issues I got it to run fine on windows xp.
However, I ran into a roadblock when trying to make it easier to distribute.
So far I've tried both cx_freeze and PyInstaller but both produce executables that fail with an error stating "ValueError: Namespace Gtk not available".
(Although PyInstaller does recommend me to install the package "gobject-introspection" for my platform, but I'm not sure where to find it)
I'm not very familiar with how these things usually work on windows.
Am I doing something wrong or is there a better recommended way to package this kind of thing?

Exe created with Pyinstaller in windows 7 is not working in xp and linux

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

GTK3 and Python3 on Windows?

Is there any way to launch a Python3 / GTK3 based application on a Windows machine? It seems that this is not that simple as with GTK2/Python2.
Thanks a lot,
Thomas
I hope, i understand the question. You Need a actual runtime of gtk3 on Windows.
inofficial gtk3.14.13 64bit-Runtime, 32bit here not available,
see:
https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer
win32 and win64: experimental official runtime 3.6.4 in http://www.gtk.org/download/index.php
is very Alpha or beta.
I hope this helps enough for gtk3.
As far as I know, there are still no official GTK3 or GObject-Introspection libraries for Windows, and so there are no python bindings.
I'm assuming you want the development kit. Windows version has indeed been missing for a long time, but there's some available now.
Going to official site and finding https://wiki.gnome.org/Projects/PyGObject, you can find a link to "Windows installers" which should lead to a rather massive all-in-one installer for Gtk3 and many related libraries for Python 3. You can load a current cpython from https://www.python.org/downloads/ and install that first.
For windows, there's also a lot of unofficial pre-built packages in http://www.lfd.uci.edu/~gohlke/pythonlibs/. Cpython 3.4 at least seems to include a functional pip for installing wheels.
I've made some use of these for running some python and matplotlib code 64-bit windows and they work rather nicely with 64-bit python 3.4. You can test with e.g. http://gtk3-matplotlib-cookbook.readthedocs.org/en/latest/ to find backend settings and other tips.

Categories