OK, for anyone else who runs into the same issue:

I see I can add multiple paths with Makespec --paths and even though it doesn't say so anywhere, these must be PYTHONPATH paths. (Makespec.py --paths = pathex entries in the spec file.)

When I looked at sys.modules to find out where wx was coming from, I discovered that if I added

/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode to the --paths this app starts to work, and the wx module is found. I guess /usr/lib/python2.6/dist-packages wasn't good enough on my first try.

- Stefan

On 5/18/2011 12:00 AM, Stefan Lisowski wrote:
Hi pyinstaller folks -

I find it strange that there's no real mention of PYTHONPATH in the
PyInstaller in the documentation
http://www.pyinstaller.org/export/latest/tags/1.5/doc/Manual.html?format=raw

or in the FAQ
http://www.pyinstaller.org/wiki/FAQ
since the PYTHONPATH is such a critical part of using Python. I looked
through mails from this newsgroup but still couldn't find any better
answers.

 From what I understand, if the PYTHONPATH is set properly for my app in
my shell and I go ahead and run the build, ie:
python /home/slisowski/download/pyi2/pyinstaller-1.5/Build.py
/opt/earthworm/ewfe/resources/client-installer/client.spec
then the current PYTHONPATH will be inherited, and I'll be good to go.

But that doesn't seem to be the case.

slisowski@polar:~/download/pyinstaller-1.5$
'/home/slisowski/earthworm/ewfe/resources/client-installer/dist/client'
Traceback (most recent call last):
File "<string>", line 10, in <module>
File "/home/slisowski/download/pyinstaller-1.5/iu.py", line 455, in
importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named wx
slisowski@polar:~/download/pyinstaller-1.5$
'/home/slisowski/earthworm/ewfe/resources/client-installer/dist/client'
Traceback (most recent call last):
File "<string>", line 10, in <module>
File "/home/slisowski/download/pyi2/pyinstaller-1.5/iu.py", line 455, in
importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named wx
slisowski@polar:~/download/pyinstaller-1.5$
'/home/slisowski/earthworm/ewfe/resources/client-installer/dist/client'
Traceback (most recent call last):
File "<string>", line 10, in <module>
File "/home/slisowski/download/pyi2/pyinstaller-1.5/iu.py", line 455, in
importHook
raise ImportError, "No module named %s" % fqname
ImportError: No module named wx

So it can't find wx. But it can find it fine if I run the app from the
.py source, from the same shell window that I'm using to run the Build.py

I read something to the effect that passing 'path' to Analysis was the
equivalent of setting a PYTHONPATH in the .spec file, but that didn't work:
got an unexpected keyword argument 'path'

And adding directories to HOMEPATH or pathex didn't get me anywhere either.

What am I missing?

Thanks.

- Stefan


my
PYTHONPATH=/usr/local/lib/python2.6:/var/python:/var/www:/var:/usr/share/python-support:/usr/local/lib/python2.6/site-packages:/usr/lib/pymodules/python2.6:/usr/lib/python2.6/dist-packages


my spec file:

# -*- mode: python -*-

def icons():
from os import listdir
from os.path import join
dir = '/opt/earthworm/ewfe/resources/icons'
for icon in listdir(dir):
if icon.endswith('.gif'):
yield (icon, join(dir, icon), 'DATA')

a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'),
os.path.join(HOMEPATH,'support/useUnicode.py'),
'/opt/earthworm/ewfe/src/ewfe/client/gui/main.py'],
pathex=['/opt/earthworm/ewfe/src/',
'/home/slisowski/download/pyinstaller-1.5'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas + [
('ewfe_client.ini', '/opt/earthworm/ewfe/resources/ewfe_client.ini',
'DATA'),
('ewfe_client.d', '/opt/earthworm/ewfe/resources/ewfe_client.d', 'DATA'),
] + list(icons()),
name=os.path.join('dist', 'client'),
debug=False,
strip=False,
upx=True,
console=1 )


--
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to