How to build an executable?

441 views
Skip to first unread message

Dan Hensley

unread,
Mar 1, 2011, 1:39:31 PM3/1/11
to pyins...@googlegroups.com
This is a pretty basic question, but it appears that trunk has been
reorganized and now the documentation is out of date. I'm looking at
PyInstaller again after a few months, and the instructions in the Readme
no longer work. It starts by saying to do

python Configure.py

But of course Configure.py is now in the utils directory. If I call it
from there, I get

python utils\Configure.py
Traceback (most recent call last):
File "utils\Configure.py", line 21, in <module>
import PyInstaller.configure
ImportError: No module named PyInstaller.configure

I'm sorry to ask such a basic question, but the documentation is out of
date and I can't find how to do step 1.

Dan

--
Dan Hensley, P.E.
Manager, Rocky Mountain Operations - ATA Engineering, Inc.
1687 Cole Blvd, Suite 125
Golden, CO W:303/945-2360
http://www.ata-e.com/

Martin Zibricky

unread,
Mar 1, 2011, 2:36:34 PM3/1/11
to pyins...@googlegroups.com
Dan Hensley píše v Út 01. 03. 2011 v 11:39 -0700:

> I'm sorry to ask such a basic question, but the documentation is out
> of
> date and I can't find how to do step 1.

Hi Dan,

It's ok to ask such a basic question. BTW, I should update the doc in
svn.

For the version in svn there is a prefered way to use the script

./trunk/pyinstaller.py

This should do all the things of Configure.py, Makespec.py and Build.py
and use the same cli arguments.

to create binary from python script:

./pyinstaller.py my_main_script.py

to create binary using a spec file:

./pyinstaller.py my_main_script.spec


It's all what should be necessary to do.

Florian Höch

unread,
Mar 1, 2011, 2:39:46 PM3/1/11
to pyins...@googlegroups.com
Hi,

pyinstaller.py is now the main 'hub' for building executables. You can
run it like this:

python pyinstaller.py [opts] yourscript.py

Which will automatically do the steps of Configure/Makespec/Build (all
the options can also be used) and create an executable.

Am 01.03.2011 19:39, schrieb Dan Hensley:
> This is a pretty basic question, but it appears that trunk has been
> reorganized and now the documentation is out of date. I'm looking at
> PyInstaller again after a few months, and the instructions in the Readme
> no longer work. It starts by saying to do
>
> python Configure.py
>
> But of course Configure.py is now in the utils directory. If I call it
> from there, I get
>
> python utils\Configure.py
> Traceback (most recent call last):
> File "utils\Configure.py", line 21, in <module>
> import PyInstaller.configure
> ImportError: No module named PyInstaller.configure
>
> I'm sorry to ask such a basic question, but the documentation is out of
> date and I can't find how to do step 1.
>
> Dan
>

Regards
--
Florian Höch

Dan Hensley

unread,
Mar 1, 2011, 2:46:43 PM3/1/11
to pyins...@googlegroups.com
Martin Zibricky wrote, On 3/1/2011 12:36 PM:
>
> Hi Dan,
>
> It's ok to ask such a basic question. BTW, I should update the doc in
> svn.
>
> For the version in svn there is a prefered way to use the script
>
> ./trunk/pyinstaller.py

Yes, that's much simpler. Unfortunately I get the following error:

File
"U:\dhensley\Projects\SRA\SRA\build_PyQt\pyinstaller-trunk\hooks\hook-pythoncom.py",
line 36, in hook
import mf
ImportError: No module named mf

Thanks,

Martin Zibricky

unread,
Mar 1, 2011, 2:48:57 PM3/1/11
to pyins...@googlegroups.com
Dan Hensley píše v Út 01. 03. 2011 v 12:46 -0700:

> Yes, that's much simpler. Unfortunately I get the following error:
>
> File
> "U:\dhensley\Projects\SRA\SRA\build_PyQt\pyinstaller-trunk\hooks
> \hook-pythoncom.py",
> line 36, in hook
> import mf
> ImportError: No module named mf
>
> Thanks,
> Dan

Well, we should check the imports of hook files.

Could you try to change 'import mf' to 'import PyInstaller.mf'?

Dan Hensley

unread,
Mar 1, 2011, 3:12:25 PM3/1/11
to pyins...@googlegroups.com

I changed the lines to

import PyInstaller.mf
mod = PyInstaller.mf.ExtensionModule(newname, pth)

and I got a bit further:

File
"U:\dhensley\Projects\SRA\SRA\build_PyQt\pyinstaller-trunk\hooks\hookutils.py",
line 42, in qt4_plugins_dir
qt4_plugin_dirs = eval(exec_statement("from PyQt4.QtCore import
QCoreApplication; app=QCoreApplication([]); print
map(unicode,app.libraryPaths())"))
File "<string>", line 0

^
SyntaxError: unexpected EOF while parsing

Reply all
Reply to author
Forward
0 new messages