Quantcast

Re: Cross compiling 32 bit application from a 64 bit Windows

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

ragini dahihande
Hello Guy,

I have one doubt.
If I have 64 bit of windows machine and I installed 32 bit python on that system.
If I create exe by PyInstaller that exe can be executed on 32 bit Windows ?

Mean for 32 bit windows exe no need to run project on 32 bit windows.
Using only 32 bit python we can create it.

Am I correct?

Thanks,
Ragini

On Tuesday, October 26, 2010 at 9:34:51 AM UTC+5:30, Andy wrote:
Hi Guys!

I've got a new computer which has the 64-bit version of Windows 7.  In
it I installed the 64-bit versions of Python, wxPython, and MySQLdb
too.  With them I made a couple of applications that compile
beautifully with PyInstaller (<a href="http://www.pyinstaller.org/ticket/25" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.pyinstaller.org%2Fticket%2F25\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUne3D_ZwNNReXeY0V8hZZnwwXVg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.pyinstaller.org%2Fticket%2F25\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUne3D_ZwNNReXeY0V8hZZnwwXVg&#39;;return true;">http://www.pyinstaller.org/ticket/25).
Thanks to all involved.

The problem is that most of the people to whom I'd be giving copies of
my compiled programs use 32-bit versions of Windows.  I already tried,
and sure enough, programs compiled in my 64-bit machine don't run in
32-bit machines.  Is there a way to compile with PyInstaller 32-bit
applications from a 64-bit computer?

Thanks,
Andy

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Steve Barnes


On 29/12/2016 06:20, ragini dahihande wrote:

> Hello Guy,
>
> I have one doubt.
> If I have 64 bit of windows machine and I installed 32 bit python on
> that system.
> If I create exe by PyInstaller that exe can be executed on 32 bit Windows ?
>
> Mean for 32 bit windows exe no need to run project on 32 bit windows.
> Using only 32 bit python we can create it.
>
> Am I correct?
>
> Thanks,
> Ragini
>

Yes you are.

For several years now I have been using a Windows 7 64 bit machine to
build python based code that runs on Windows 32 bit machines elsewhere -
All I do is to use the 32 bit version of python to do it.  The only
major issue I have is that some of the machines still run XP and the
last version of python to support XP is 3.4 but hopefully we will
eventually replace the XP machines.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

davecortesi
In reply to this post by ragini dahihande

 For several years now I have been using a Windows 7 64 bit machine to
build python based code that runs on Windows 32 bit machines elsewhere -
All I do is to use the 32 bit version of python to do it.

It's good that works but you really should not count on it. The manual is specific about not being a "cross-compiler" and says if you want to bundle for a specific OS you need to run on that OS. My point being, if it ever breaks, you won't get a fix.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Steve Barnes


On 29/12/2016 15:52, davecortesi wrote:

>
>      For several years now I have been using a Windows 7 64 bit machine to
>     build python based code that runs on Windows 32 bit machines
>     elsewhere -
>     All I do is to use the 32 bit version of python to do it.
>
>
> It's good that works but you really should not count on it. The manual
> is specific about not being a "cross-compiler" and says if you want to
> bundle for a specific OS you need to run on that OS. My point being, if
> it ever breaks, you won't get a fix.

Building 32 bit Windows Python Applications on a 64 bit platform is not
cross compiling when you are running 32 bit python on that platform - 32
bit Python under Windows runs with exactly the same instruction set and
memory model regardless of running on Windows 64 bit or 32 bit.

pyInstaller, (or py2exe or cxFreeze), embed the local copy of python,
and the required libraries, into the created package and the 32 bit
windows python installation is the same regardless of being installed on
a 32 bit or 64 bit machine.  What you cannot do is deploy applications
built with 64 bit Windows python, (and it's libraries), on 32 bit
Windows machines. Needless say 32 bit deployments can also run on 64 bit
machines but it is a very good idea to run your tests using the exact
same version(s) of python that you are going to deploy with.

If you are even slightly worried you can build & test in a virtual
machine under vagrant or virtualbox, test VMs can be found at
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ you just
have to install python and the libraries that you need before your test
& build.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Coyot Linden (Glenn Glazer)
On 12/29/16 08:59, Steve Barnes wrote:
On 29/12/2016 15:52, davecortesi wrote:
     For several years now I have been using a Windows 7 64 bit machine to
    build python based code that runs on Windows 32 bit machines
    elsewhere -
    All I do is to use the 32 bit version of python to do it.


It's good that works but you really should not count on it. The manual
is specific about not being a "cross-compiler" and says if you want to
bundle for a specific OS you need to run on that OS. My point being, if
it ever breaks, you won't get a fix.
Building 32 bit Windows Python Applications on a 64 bit platform is not 
cross compiling when you are running 32 bit python on that platform - 32 
bit Python under Windows runs with exactly the same instruction set and 
memory model regardless of running on Windows 64 bit or 32 bit.

pyInstaller, (or py2exe or cxFreeze), embed the local copy of python, 
and the required libraries, into the created package and the 32 bit 
windows python installation is the same regardless of being installed on 
a 32 bit or 64 bit machine.  What you cannot do is deploy applications 
built with 64 bit Windows python, (and it's libraries), on 32 bit 
Windows machines. Needless say 32 bit deployments can also run on 64 bit 
machines but it is a very good idea to run your tests using the exact 
same version(s) of python that you are going to deploy with.

If you are even slightly worried you can build & test in a virtual 
machine under vagrant or virtualbox, test VMs can be found at 
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ you just 
have to install python and the libraries that you need before your test 
& build.


Based on this thread, we tried to solve a problem:

Right now, all of our software clients are 32 bit C++ executables, but we are making the migration to 64 bit for those that have 64 bit systems.  Since we don't know on first download of an updated client whether the client host is 32 or 64, we wanted to download a 32 bit version of the our python shim which would then detect the correct bitness and ask our servers for the right thing.

Unfortunately we seem to be running into problems with this scheme.   On a 64bit host, we have both 32 and 64 bit python and pyinstaller installed.  Using the 32 bit version, we compiled our scripts and got "Failed to execute script" when we ran them. 

I then wrote a hello world script (e.g., just the shebang and the print) and while python hello_world.py works, hello_world.exe just exits with no output.

Suggestions on how to solve this welcome.

Best,

coyot
GLENN GLAZER | Senior Software Engineer
m:
562.305.2920 | email:  [hidden email] | Second Life: Coyot Linden
LINDEN LAB | Create Virtual Experiences

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Coyot Linden (Glenn Glazer)
On 3/13/17 16:50, Coyot Linden (Glenn Glazer) wrote:
Based on this thread, we tried to solve a problem:

Right now, all of our software clients are 32 bit C++ executables, but we are making the migration to 64 bit for those that have 64 bit systems.  Since we don't know on first download of an updated client whether the client host is 32 or 64, we wanted to download a 32 bit version of the our python shim which would then detect the correct bitness and ask our servers for the right thing.

Unfortunately we seem to be running into problems with this scheme.   On a 64bit host, we have both 32 and 64 bit python and pyinstaller installed.  Using the 32 bit version, we compiled our scripts and got "Failed to execute script" when we ran them. 

I then wrote a hello world script (e.g., just the shebang and the print) and while python hello_world.py works, hello_world.exe just exits with no output.

Suggestions on how to solve this welcome.

Best,

coyot
GLENN GLAZER | Senior Software Engineer
m:
562.305.2920 | email:  [hidden email] | Second Life: Coyot Linden
LINDEN LAB | Create Virtual Experiences


Update on this.  It turns out that the bitness was a false trail.  After a great deal of work late into last night, we discovered that the same python code, built by the same machine with the same python works completely correctly as an exe if the -w is left off and fails completely if it does.  This is true of both hello world (which outputs nothing) and our shim (which causes the failed to execute window).

The unfortunate part of this discovery is that the console window does pop up for awhile prior to the actual executable starting.  This is aesthetically unpleasing but certainly better than not functioning at all.

Again, suggestions are welcome.

Best,

coyot
GLENN GLAZER | Senior Software Engineer
m:
562.305.2920 | email:  [hidden email] | Second Life: Coyot Linden
LINDEN LAB | Create Virtual Experiences




--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Hartmut Goebel
Am 14.03.2017 um 16:03 schrieb Coyot Linden (Glenn Glazer):
Again, suggestions are welcome.
A pull-request related to this is wellcome, too :-)

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/35.000-gegen-vorratdatenspeicherung
Kolumne: http://www.cissp-gefluester.de/2012-09-steht-ein-manta-fahrer-vor-der-uni

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

0xBF773B65.asc (14K) Download Attachment
smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling 32 bit application from a 64 bit Windows

Steve Barnes
In reply to this post by Coyot Linden (Glenn Glazer)

[Snip]

>
> The unfortunate part of this discovery is that the console window does
> pop up for awhile prior to the actual executable starting.  This is
> aesthetically unpleasing but certainly better than not functioning at all.
>
> Again, suggestions are welcome.
>
> Best,
>
> coyot

It would be worth trying the same script, on the same machine, with
pythonw script_name.py

It is possible that your pythonw executable is missing or broken.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Loading...