Discussion:
[BitPim-devel] Setting upthe dev environment in Mac OS X
Greg Pratt
2006-04-06 20:18:57 UTC
Permalink
I finally had some time this week to set up the development environment
on my Mac OS X 10.4.5 system (PPC). I've run into a problem running
bp.py that leads me to think that I've missed something.

First, I built pySerial (2.2), swig (1.3.29), APSW (3.2.7-r1), and
libusb (0.1.12) from source, and installed wxPython 2.6.3.2 (Unicode)
via the pre-built package provided at www.wxpython.org. This last item
went into its default install location (most of the pieces reside in
/Library/Python/2.3/). The rest of the pieces were either installed in
/usr/local or /Library/Python/2.3//site-packages, as appropriate.

I installed Subversion and retrieved the entire source tree:

svn co https://svn.sourceforge.net/svnroot/bitpim/trunk/bitpim

I then set up BitPim and tried running it, with an annoying failure:

$ env | grep -i python
LD_LIBRARY_PATH=/Library/Python/2.3/wx-2.6-mac-unicode/wx
PYTHONPATH=/Library/Python/2.3/wx-2.6-mac-unicode/wxPython

$ python packaging/buildmodules.py
===== src/native/usb
SWIG Version 1.3.29
/usr/local/include/usb.h:329: Warning(302): Identifier 'usb_device' redefined (ignored),
/usr/local/include/usb.h:241: Warning(302): previous definition of 'usb_device'.
===== src/native/strings
running build
running build_ext
building 'jarow' extension
creating build
creating build/temp.darwin-8.5.0-Power_Macintosh-2.3
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c jarow.c -o build/temp.darwin-8.5.0-Power_Macintosh-2.3/jarow.o
creating build/lib.darwin-8.5.0-Power_Macintosh-2.3
gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup build/temp.darwin-8.5.0-Power_Macintosh-2.3/jarow.o -o build/lib.darwin-8.5.0-Power_Macintosh-2.3/jarow.so

$ python src/bp.py
Traceback (most recent call last):
File "src/bp.py", line 90, in ?
import gui
File "/Volumes/Backups/bitpim/src/gui.py", line 41, in ?
import phonebook
File "/Volumes/Backups/bitpim/src/phonebook.py", line 101, in ?
import phonebookentryeditor
File "/Volumes/Backups/bitpim/src/phonebookentryeditor.py", line 17, in ?
import wallpaper
File "/Volumes/Backups/bitpim/src/wallpaper.py", line 23, in ?
import brewcompressedimage
File "/Volumes/Backups/bitpim/src/brewcompressedimage.py", line 225, in ?
class BCIImageHandler(wx.PyImageHandler):
AttributeError: 'module' object has no attribute 'PyImageHandler'

I'm not familiar with Python or the wxWidgets, so I'm not sure why
PyImageHandler can't be associated with any library or Python file.
I'm hoping this is a missing line of documentation or a "doh!" moment.
What might I be missing here?

--
Gregory Pratt ***@panix.com
East Rutherford, NJ, USA http://www.panix.com/~gp/
"The only good spammer is a dead spammer."
PGP Key Fingerprint: DC60 FCDE 91E2 3D41 91A3 45DB B474 3D3A 3621 AAFE
Joe Pham
2006-04-07 01:02:54 UTC
Permalink
I have wxPython 2.6.3.2 running ok on Windows. It sounds like you might be running an older version of wxPython. I'd suggest uninstalling all wxPython packages, and re-install the latest one.

-Joe Pham




_____________________________________________________________________
Call Anyone, Anytime, Anywhere in the World - FREE!
Free Internet calling from NetZero Voice
Visit http://www.netzerovoice.com today!
Greg Pratt
2006-04-07 03:05:23 UTC
Permalink
On Thursday, 06 April 2006, Joe Pham is rumored to have said...
Post by Joe Pham
I have wxPython 2.6.3.2 running ok on Windows. It sounds like you might be ru
+nning an older version of wxPython.
As I said in my original e-mail, it's 2.6.3.2 -- the most recent version.

Earlier, I tried building wxPython 2.6.3.2 from source, with the same
results. In that case, however, I couldn't figure out how to get
wxPython to install the necessary configs in /Library/Python/2.3.

I haven't tried Python 2.4, but I rather doubt that's necessary. BitPim
seems to run just fine as a built app using the system's built-in
python, which is 2.3.5.

My guess is that bp.py just doesn't know where to find wxPython's
pieces. I've had PYTHONPATH defined and pointing to
/Library/Python/2.3/wx-2.6-mac-unicode/wxPython, but I don't know
if that variable is even the one I should be concerned about in this
case.

--
Gregory Pratt ***@panix.com
East Rutherford, NJ, USA http://www.panix.com/~gp/
"The only good spammer is a dead spammer."
PGP Key Fingerprint: DC60 FCDE 91E2 3D41 91A3 45DB B474 3D3A 3621 AAFE
Greg Pratt
2006-04-07 03:36:29 UTC
Permalink
On Thursday, 06 April 2006, Greg Pratt is rumored to have said...
Post by Greg Pratt
My guess is that bp.py just doesn't know where to find wxPython's
pieces. I've had PYTHONPATH defined and pointing to
/Library/Python/2.3/wx-2.6-mac-unicode/wxPython, but I don't know
if that variable is even the one I should be concerned about in this
case.
Re-reading my earlier message got me thinking: the docs for wxPython
state that I should "...ensure that the directory containing wxPython is
contained in the PYTHONPATH environment variable." Hmm, one-off error?

I changed $PYTHONPATH from

/Library/Python/2.3/wx-2.6-mac-unicode/wxPython

...to...

/Library/Python/2.3/wx-2.6-mac-unicode

Voila!

The only other change needed is to change the invocation of bp.py from
"python" to "pythonw". If you forget this, "python" will tell you. :)

$ python src/bp.py
This program needs access to the screen. Please run with 'pythonw',
not 'python', and only when you are logged in on the main display of
your Mac.
canis-major:~/src/bitpim/bitpim gpratt$ pythonw src/bp.py
not returning a bitmap for wxART_ADD_BOOKMARK
not returning a bitmap for wxART_DEL_BOOKMARK
You need to make helphelp.png
[...]

I haven't tested the code yet, but at least now it will load properly.

To review, this can be used to run BitPim from the development download
under Mac OS X 10.4 where you've got the pre-built binary of wxPython
installed:

export PYTHONPATH=/Library/Python/2.3/wx-2.6-mac-unicode
cd /path/to/bitpim
python packaging/buildmodules.py
pythonw src/bp.py

--
Gregory Pratt ***@panix.com
East Rutherford, NJ, USA http://www.panix.com/~gp/
"The only good spammer is a dead spammer."
PGP Key Fingerprint: DC60 FCDE 91E2 3D41 91A3 45DB B474 3D3A 3621 AAFE
Roger Binns
2006-04-08 04:05:04 UTC
Permalink
Post by Greg Pratt
My guess is that bp.py just doesn't know where to find wxPython's
pieces.
I believe the root cause is that Apple gratuitously changed how
site-packages is dealt with between 10.3. and 10.4.

Installing this should fix it:

http://undefined.org/python/#TigerPython23Compat

Roger

Christopher R. White
2006-04-07 06:37:23 UTC
Permalink
Anybody willing to work on the LG MM 535? I can make a filesystem dump
if you're interested. So far, this phone seems very similar to my old
PM-325 in as much as the menu layout, scheme, etc.

Contact me off list to arrange for filesystem transfer if interested.
Simon C
2006-04-07 02:27:40 UTC
Permalink
Post by Greg Pratt
I finally had some time this week to set up the development
environment on my Mac OS X 10.4.5 system (PPC). I've run
into a problem running bp.py that leads me to think that I've
missed something.
I can't help you but I can confirm that I have exactly the same problem on
my mac.
I have dual boot (10.3 and 10.4) 10.3 works, 10.4 fails. I think I went
through the same steps for each O/S.
10.4 comes with python 2.3.5, I tried upgrading to 2.4 but it did not help.
The fact I have it working on 10.3 has stopped me from trying to figure out
why.


Simon
Loading...