Trouble building

2 views
Skip to first unread message

zeo

unread,
Apr 28, 2008, 8:18:22 PM4/28/08
to PyInstaller
Hi!
I can't build the following code:

class Foo:
def __init__(self, val):
self.val = val

def main():
f = Foo("success")
print f.val

if __name__=="__main__":
main()

NameError: global name 'Foo' is not defined

Have I missed something or do I have to put Foo in Foo.py and import
it?

Matteo Bertini

unread,
Apr 29, 2008, 5:45:13 AM4/29/08
to PyInstaller
It works for me... is your a PyInstaller-only problem or a Python
problem? Can you provide the full traceback?

--
Matteo Bertini

zeo

unread,
Apr 29, 2008, 8:19:33 AM4/29/08
to PyInstaller
> It works for me... is your a PyInstaller-only problem or a Python
> problem? Can you provide the full traceback?

It's a PyInstaller problem only. I have no problem running the code.
I have only tested on windows so far.

c:\Python25\pyinstaller-1.3>Configure.py
I: computing EXE_dependencies
I: Finding TCL/TK...
I: found TCL/TK version 8.4
I: testing for Zlib...
I: ... Zlib available
I: Testing for ability to set icons, version resources...
I: ... resource update available
I: Testing for Unicode support...
I: ... Unicode available
I: testing for UPX...
I: ...UPX unavailable
I: computing PYZ dependencies...

F:\python\obfuscator>Makespec.py test.py
wrote F:\python\obfuscator\test.spec
now run Build.py to build the executable

F:\python\obfuscator>Build.py test.py
Traceback (most recent call last):
File "C:\Python25\pyinstaller-1.3\Build.py", line 839, in <module>
build(sys.argv[1])
File "C:\Python25\pyinstaller-1.3\Build.py", line 76, in build
exec open(spec, 'r').read()+'\n'
File "<string>", line 12, in <module>
File "<string>", line 8, in main

zeo

unread,
Apr 29, 2008, 8:27:11 AM4/29/08
to PyInstaller
I found the error now ;-)
I should RTFM when I'm not tired.

Thanx for your time.

michael

unread,
Jun 22, 2008, 12:20:19 PM6/22/08
to PyInstaller
I need your help. how did you solve this problem?

zeo

unread,
Jun 23, 2008, 6:47:07 AM6/23/08
to PyInstaller
The error was that I ran Build.py on my python source code file and
not on the generated specfile.
http://pyinstaller.hpcf.upr.edu/docs/Manual_v1.1.html

Maybe a specfile check in Build.py would be a nice feature.
Reply all
Reply to author
Forward
0 new messages