How to choose Pyinstaller Python compiler on Raspberry PI?
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
> 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 …
> python3 /path/to/pyinstaller/pyinstaller.py …
> Schönen Gruß
> Hartmut Goebel
> Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
> Information Security Management, Security Governance, Secure Software
> 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.