Quantcast

How to choose Pyinstaller Python compiler on Raspberry PI?

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

How to choose Pyinstaller Python compiler on Raspberry PI?

Gianluca Storti
Hi everyone, 
in the last days, I have finally finished my project and I started using PyInstaller, actually a great and easy tool for compiling python!

My project, that uses a Raspberry Pi 2 and Jessie OS, is composed of files for Python2.7 and files for Python3 and here is the problem:

First, I have successfully installed PyInstaller on my Raspberry using pip -> "sudo pip install pyinstaller", and after I compiled one of my files that uses Python2.7 using "sudo pyinstaller --onefile my_file.py". The result is great and everything worked.

Afterward, I have installer PyInstaller per Python3 using "sudo pip3 install pyinstaller", and I have compiled another file that uses Python3 using  "sudo pyinstaller --onefile my_file_for_python3.py". The result is great and everything worked.

HERE is the problem: if now I want to compile the first file that uses Python2.7, PyInstaller is not able to prperly do it because it will use always the Python3 compiler (I can see in the log).....it seems once you upgrade to the version of PyInstaller for python3, every file will be compiled using Python3 compiler without choice.

Is anyone able to guide me how to fix this problem? I searched in the PyInstaller manual but I was not able to find any option to specify the compiler on the command line

Thanks in advance

--
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: How to choose Pyinstaller Python compiler on Raspberry PI?

Hartmut Goebel
Am 15.09.2016 um 19:50 schrieb Gianluca Storti:
Is anyone able to guide me how to fix this problem? I searched in the PyInstaller manual but I was not able to find any option to specify the compiler on the command line

Both pip and pip3 install the pyinstaller script into the same place (e.g. /usr/bin). There are two solutions

a) set up a virtual env for one (or for both) installations
b) do not *install* pyinstaller, but jsut download and unpack the archive. Then you can run it using either
python2 /path/to/pyinstaller/pyinstaller.py …
or
python3 /path/to/pyinstaller/pyinstaller.py …
HTH

--
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/get-current-locale-with-ansible
Kolumne: http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim

--
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.

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

Re: How to choose Pyinstaller Python compiler on Raspberry PI?

Hartmut Goebel
Am 16.09.2016 um 13:22 schrieb Hartmut Goebel:
b) do not *install* pyinstaller, but jsut download and unpack the archive. Then you can run it using either

For this see https://pyinstaller.readthedocs.io/en/stable/installation.html#installing-from-the-archive


--
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/get-current-locale-with-ansible
Kolumne: http://www.cissp-gefluester.de/2010-08-scheingefechte-um-rim

--
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.

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

Re: How to choose Pyinstaller Python compiler on Raspberry PI?

Steve Barnes
In reply to this post by Hartmut Goebel


On 16/09/2016 12:22, Hartmut Goebel wrote:

> Am 15.09.2016 um 19:50 schrieb Gianluca Storti:
>> Is anyone able to guide me how to fix this problem? I searched in the
>> PyInstaller manual but I was not able to find any option to specify
>> the compiler on the command line
>
> Both pip and pip3 install the pyinstaller script into the same place
> (e.g. /usr/bin). There are two solutions
>
> a) set up a virtual env for one (or for both) installations
> b) do not *install* pyinstaller, but jsut download and unpack the
> archive. Then you can run it using either
>
>     python2 /path/to/pyinstaller/pyinstaller.py …
>
> or
>
>     python3 /path/to/pyinstaller/pyinstaller.py …
>
> HTH
>
> --
> 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
>

A 3rd option is to have one SD card with Raspberian installed with
PyInstaller for Python 2 and another for Python 3, (SD cards are not
that expensive), or even a separate RaspberryPi for each.

--
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...