I’m trying to install "Winpdb"http://winpdb.org/ on Mac OS X 10.6.5, which requires wxPython.
We’re using "virtualenv"http://virtualenv.openplans.org/ on top of Python 2.6. The Python 2.6 binary was built with the "Homebrew"https://github.com/cozi/homebrew package manager. This combination gives a consistent environment on different Macs.
I tried copying wxredirect.pth into my virtualenv’s site-packages. However, import winpdb
fails with:
...
ImportError: dlopen(/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so, 2): no suitable image found. Did find:
/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no matching architecture in universal wrapper
Presumably because this is a home-built Python, not the system one.
It looks like I have to build wxPython myself, and I’ve adapted the instructions at http://codersbuffet.blogspot.com/2009/09/wxpython-in-virtualenv.html
However, I get this error building wxPython with Xcode 3.2.5:
./src/common/intl.cpp:2060: error: ‘smScriptLang’ was not declared in this scope
Here’s how I got to that point
Install Brew:
$ sudo chown -R $USER /usr/local
$ curl -Lsf http://github.com/cozi/homebrew/tarball/master | tar xz --strip 1 -C/usr/local
Use Brew to install Python 2.6 and "Pip"http://pip.openplans.org/:
$ brew install python pip
Install virtualenv with pip:
$ pip install virtualenv
Create a virtualenv called kitspython:
$ virtualenv --no-site-packages ~/kitspython
Activate the virtualenv:
$ source ~/kitspython/bin/activate
Start building wxPython:
$ tar -jxvf ~/Downloads/wxPython-src-*.tar.bz2
$ cd wxPython-src-*
$ ./configure --prefix=$(cd ~/kitspython/; pwd) --enable-unicode
Configured wxWidgets 2.8.11 for `i686-apple-darwin10.5.0'
Which GUI toolkit should wxWidgets use? mac
Should wxWidgets be compiled into single library? no
Should wxWidgets be compiled in debug mode? no
Should wxWidgets be linked as a shared library? yes
Should wxWidgets be compiled in Unicode mode? yes
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.4 no
wxWidgets 2.6 yes
Which libraries should wxWidgets use?
jpeg builtin
png builtin
regex builtin
tiff builtin
zlib sys
odbc no
expat sys
libmspack no
sdl no
$ make install
…
/Users/georger/wxPython-src-2.8.11.0/bk-deps g++ -c -o basedll_intl.o -I./.pch/wxprec_basedll -D__WXMAC__ -DWXBUILDING -I./src/tiff -I./src/jpeg -I./src/png -I./src/regex -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -dynamic -fPIC -DPIC -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I/Users/georger/wxPython-src-2.8.11.0/lib/wx/include/mac-unicode-release-2.8 -I./include -fpascal-strings -I./src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon -DWX_PRECOMP -Wall -Wundef -Wno-ctor-dtor-privacy -O2 -fno-strict-aliasing -fno-common ./src/common/intl.cpp
./src/common/intl.cpp: In static member function ‘static int wxLocale::GetSystemLanguage()’:
./src/common/intl.cpp:2060: error: ‘smScriptLang’ was not declared in this scope
./src/common/intl.cpp:2060: error: ‘GetScriptVariable’ was not declared in this scope
./src/common/intl.cpp:2061: warning: ‘GetScriptManagerVariable’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h:993)
./src/common/intl.cpp:2061: warning: ‘GetScriptManagerVariable’ is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h:993)
make: *** [basedll_intl.o] Error 1
This is a second-order problem, of course. All I really care about is running Winpdb inside the virtualenv.
Thanks in advance
/George