awent0428
Posts: 9
Joined: Mon Oct 20, 2014 1:46 am

Python to Executable

Mon May 11, 2015 2:57 am

I am wanting to convert my Python application into a Windows executable on my Raspberry Pi. I am not too sure on how to do this. I was going to install the Pi3D libraries onto my Windows computer, but didn't fully understand how to install them. How can I convert my file? I tried to install Pyinstaller, but an error popped up.

User avatar
electronicsguy
Posts: 156
Joined: Wed Jan 21, 2015 11:20 pm
Contact: Website

Re: Python to Executable

Mon May 11, 2015 3:05 am

blog: https://electronicsguy.wordpress.com
github: https://github.com/electronicsguy

awent0428
Posts: 9
Joined: Mon Oct 20, 2014 1:46 am

Re: Python to Executable

Mon May 11, 2015 3:50 am

That was not helpful.

User avatar
electronicsguy
Posts: 156
Joined: Wed Jan 21, 2015 11:20 pm
Contact: Website

Re: Python to Executable

Mon May 11, 2015 4:06 am

Did you read the first link? Seems to describe exactly what you want. What exactly did you not find helpful?
blog: https://electronicsguy.wordpress.com
github: https://github.com/electronicsguy

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Python to Executable

Mon May 11, 2015 6:38 am

awent0428 wrote:
That was not helpful.
That was our friends way of saying, "Google is our friend". (which is usually a pejorative phrase meaning that you might be willing to do a little searching before bugging the forum)

If I understand your question you want to create the executable to run on windows 'using' your raspberry pi as the cross compiler?\

hint: you do realize that python is an interpreted language? Python runs everywhere.
marcus
:ugeek:

User avatar
paddyg
Posts: 2306
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Python to Executable

Mon May 11, 2015 6:45 am

Is this a reasonable summary of your question?

You have made a python app on the Raspberry Pi using the pi3d library and would like to run it on a windows machine. You looked at the instructions for getting pi3d to run on windows and ran into problems or just thought it would be easier to package the app in a windows exe. You looked at the introductions for py2exe and pyinstaller and decided on the latter, tried to install it on your Raspberry Pi but got an error message at some stage?

I've not used pyinstaller but their FAQ says that it only works on windows. But thinking about it, if you are packaging something to run on windows, starting from the position of having it already running on windows is probably a good idea!

Which comes back to the issue of setting up pi3d on your windows computer. This basically requires installation of python and then the modules: PIL (Pillow), numpy, pygame and the pi3d source from github. It also requires you to find the two gpu dll files and edit the constants.__init__.py file to point to them. (If you packaged your application as a windows executable not only would you have to find the correct versions of these files (there were several on my computer and half didn't work!) and put them in the package, you would also have to include various microsoft runtime interpreter dll files, prossibly requiring you to have installed visual studio etc.)

So the first step, even if you want to make an exe eventually, is to get it all running smoothly on windows. Let me know what problems you run into.

Paddy

lmgt ;)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

awent0428
Posts: 9
Joined: Mon Oct 20, 2014 1:46 am

Re: Python to Executable

Mon May 11, 2015 3:07 pm

paddyg wrote:Is this a reasonable summary of your question?

You have made a python app on the Raspberry Pi using the pi3d library and would like to run it on a windows machine. You looked at the instructions for getting pi3d to run on windows and ran into problems or just thought it would be easier to package the app in a windows exe. You looked at the introductions for py2exe and pyinstaller and decided on the latter, tried to install it on your Raspberry Pi but got an error message at some stage?

I've not used pyinstaller but their FAQ says that it only works on windows. But thinking about it, if you are packaging something to run on windows, starting from the position of having it already running on windows is probably a good idea!

Which comes back to the issue of setting up pi3d on your windows computer. This basically requires installation of python and then the modules: PIL (Pillow), numpy, pygame and the pi3d source from github. It also requires you to find the two gpu dll files and edit the constants.__init__.py file to point to them. (If you packaged your application as a windows executable not only would you have to find the correct versions of these files (there were several on my computer and half didn't work!) and put them in the package, you would also have to include various microsoft runtime interpreter dll files, prossibly requiring you to have installed visual studio etc.)

So the first step, even if you want to make an exe eventually, is to get it all running smoothly on windows. Let me know what problems you run into.

Paddy

lmgt ;)
Thank you! You understand! Later today, I will be trying this out.

awent0428
Posts: 9
Joined: Mon Oct 20, 2014 1:46 am

Re: Python to Executable

Mon May 11, 2015 3:10 pm

MarkHaysHarris777 wrote:
awent0428 wrote:
That was not helpful.
That was our friends way of saying, "Google is our friend". (which is usually a pejorative phrase meaning that you might be willing to do a little searching before bugging the forum)

If I understand your question you want to create the executable to run on windows 'using' your raspberry pi as the cross compiler?\

hint: you do realize that python is an interpreted language? Python runs everywhere.
I understand, but of course I went searching for help before coming to the forums. I didn't find anything useful.

User avatar
paddyg
Posts: 2306
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Python to Executable

Mon May 11, 2015 4:27 pm

I do have a genuine interest in what problems you run into trying to get things set up on windows - so any comments +ve or -ve would be welcome.

The process of getting all the python components installed was a bit messy, but I think having Anaconda installed didn't help. Also, although the pygame website looks like it stalled back in 2009 there is quite a bit of activity on their github repository so, hopefully that will soon be reflected in some more current downloads and windows installers (py3.4 and 64 bit versions etc).

Also, it's not bad to have a version running on a laptop or desktop computer as development and debugging is quite a bit quicker than on the RPi!
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”