1 <?xml version=
"1.0" encoding=
"iso-8859-1" ?> 
   2 <!DOCTYPE html PUBLIC 
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
   3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en"> 
   5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=iso-8859-1" /> 
   6 <meta name=
"generator" content=
"Docutils 0.4: http://docutils.sourceforge.net/" /> 
   7 <title>Installing wxPython 
2.7 from Source
</title> 
   8 <style type=
"text/css"> 
  11 :Author: David Goodger
 
  12 :Contact: goodger@users.sourceforge.net
 
  15 :Copyright: This stylesheet has been placed in the public domain.
 
  17 Default cascading style sheet for the HTML output of Docutils.
 
  19 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
 
  20 customize this style sheet.
 
  23 /* used to remove borders from tables and images */
 
  24 .borderless, table.borderless td, table.borderless th {
 
  27 table.borderless td, table.borderless th {
 
  28   /* Override padding for "table.docutils td" with "! important".
 
  29      The right padding separates the table cells. */
 
  30   padding: 
0 0.5em 
0 0 ! important }
 
  33   /* Override more specific margin styles with "! important". */
 
  34   margin-top: 
0 ! important }
 
  36 .last, .with-subtitle {
 
  37   margin-bottom: 
0 ! important }
 
  43   text-decoration: none ;
 
  50   margin-bottom: 
0.5em }
 
  52 /* Uncomment (and remove this text!) to get bold-faced definition list terms
 
  60 div.abstract p.topic-title {
 
  64 div.admonition, div.attention, div.caution, div.danger, div.error,
 
  65 div.hint, div.important, div.note, div.tip, div.warning {
 
  67   border: medium outset ;
 
  70 div.admonition p.admonition-title, div.hint p.admonition-title,
 
  71 div.important p.admonition-title, div.note p.admonition-title,
 
  72 div.tip p.admonition-title {
 
  74   font-family: sans-serif }
 
  76 div.attention p.admonition-title, div.caution p.admonition-title,
 
  77 div.danger p.admonition-title, div.error p.admonition-title,
 
  78 div.warning p.admonition-title {
 
  81   font-family: sans-serif }
 
  83 /* Uncomment (and remove this text!) to get reduced vertical space in
 
  85 div.compound .compound-first, div.compound .compound-middle {
 
  86   margin-bottom: 
0.5em }
 
  88 div.compound .compound-last, div.compound .compound-middle {
 
  97 div.dedication p.topic-title {
 
 105 div.footer, div.header {
 
 114 div.line-block div.line-block {
 
 121   border: medium outset ;
 
 123   background-color: #ffffee ;
 
 128 div.sidebar p.rubric {
 
 129   font-family: sans-serif ;
 
 132 div.system-messages {
 
 135 div.system-messages h1 {
 
 139   border: medium outset ;
 
 142 div.system-message p.system-message-title {
 
 149 h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
 
 150 h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
 
 168 ol.simple, ul.simple {
 
 172   list-style: decimal }
 
 175   list-style: lower-alpha }
 
 178   list-style: upper-alpha }
 
 181   list-style: lower-roman }
 
 184   list-style: upper-roman }
 
 198   white-space: nowrap }
 
 207   font-family: sans-serif ;
 
 212   font-family: sans-serif ;
 
 224 pre.literal-block, pre.doctest-block {
 
 227   background-color: #eeeeee }
 
 230   font-family: sans-serif ;
 
 231   font-style: oblique }
 
 233 span.classifier-delimiter {
 
 234   font-family: sans-serif ;
 
 238   font-family: sans-serif }
 
 241   white-space: nowrap }
 
 249 span.section-subtitle {
 
 250   /* font-size relative to parent (h1..h6 element) */
 
 254   border-left: solid 
1px gray;
 
 262   margin-bottom: 
0.5em }
 
 265   border-left: solid 
1px black;
 
 268 table.docutils td, table.docutils th,
 
 269 table.docinfo td, table.docinfo th {
 
 270   padding-left: 
0.5em ;
 
 271   padding-right: 
0.5em ;
 
 272   vertical-align: top }
 
 274 table.docutils th.field-name, table.docinfo th.docinfo-name {
 
 277   white-space: nowrap ;
 
 280 h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
 
 281 h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
 
 285   background-color: #eeeeee }
 
 288   list-style-type: none }
 
 293 <div class=
"document" id=
"installing-wxpython-2-7-from-source"> 
 294 <h1 class=
"title">Installing wxPython 
2.7 from Source
</h1> 
 295 <p>This document will describe the few differences and additions to the
 
 296 content in the 
<a class=
"reference" href=
"BUILD.html">BUILD
</a> document for installing wxPython built from
 
 297 source.  Please follow the intstructions both in this file and in
 
 298 <a class=
"reference" href=
"BUILD.html">BUILD
</a> to perform this task.  Where there is overlap the items
 
 299 described here will take precedence for doing installations.
</p> 
 300 <div class=
"section"> 
 301 <h1><a id=
"installing-on-unix-like-systems-not-os-x" name=
"installing-on-unix-like-systems-not-os-x">Installing on Unix-like Systems (not OS X)
</a></h1> 
 303 <li><p class=
"first">When building wxWidgets you need to decide if you want it to be a
 
 304 private copy only accessed by wxPython, or if you would like it to
 
 305 be installed in a stanard location such as /usr.  Or perhaps you
 
 306 already have a version of wxWidgets installed on your system (such
 
 307 as from an RPM) and you want wxPython to use that version too.  If
 
 308 so then you'll want to ensure that the flags and options used to
 
 309 build the installed version are compatible with wxPython.
</p> 
 311 <li><p class=
"first">If you do decide to build and install your own wxWidgets then there
 
 312 are a few tweaks to the configure flags described in BUILD.txt that
 
 313 you will probably want to make.  Instead of --enable-debug use
 
 314 this configure flag:
</p> 
 315 <pre class=
"literal-block"> 
 318 <p>Normally I also use the following flag in order to have wxWidgets
 
 319 runtime assertions turned into Python exceptions where possible.
 
 320 It does add extra code to the build but probably not enough to
 
 321 worry about it.  However if you want to get as lean a build as
 
 322 possible you can leave it out, but if your code does something bad
 
 323 then instead of exceptions you'll likely get a crash:
</p> 
 324 <pre class=
"literal-block"> 
 325 --enable-debug_flag \
 
 327 <p>If you are building a private copy of wxWidgets (IOW, not installed
 
 328 in a standard library location) then it can be kind of a hassle to
 
 329 always have to set the LD_LIBRARY_PATH variable so wxPython can
 
 330 find the wxWidgets shared libraries.  You can hard code the library
 
 331 path into the binaries by using the rpath option when configuring
 
 332 wxWidgets.  For example:
</p> 
 333 <pre class=
"literal-block"> 
 334 --enable-rpath=/opt/wx/
2.7/lib \
 
 336 <p>SOLARIS NOTE: The --enable-rpath option may cause problems when
 
 337 using wxGTK on Solaris when compiling wxPython as described below.
 
 338 The woraround is to not use --enable-rpath flag for configure, but
 
 339 in that case all wxPython applications 
<em>must
</em> have the
 
 340 LD_LIBRARY_PATH set to include $WXPREF/lib, or you can use the
 
 341 'crle' program to modify the runtime linking environment.  If this
 
 342 is the only installation of wxGTK on the system then you can use a
 
 343 system library path for prefix and not have to worry about it at
 
 346 <li><p class=
"first">Build and install wxGTK as described in BUILD.txt.
</p> 
 348 <li><p class=
"first">In addition to building wxPython as described in BUILD.txt, you can
 
 349 install it to Python's site-packages dir, as well as some scripts
 
 350 into the same bin dir used by Python by using this command, plus
 
 351 whatever WXPORT, UNICODE, etc. settings you used for the initial
 
 353 <pre class=
"literal-block"> 
 354 python2.5 setup.py install
 
 356 <p>If you would like to install to some place besides the prefix where
 
 357 Python is installed, (such as to your home directory) then you can
 
 358 add 
"--root=
<path
>" after the 
"install
" command.  This will use
 
 359 <path
> as the prefix and will install scripts to a bin subdir and
 
 360 the wxPython packages to a lib subdir.  To use wxPython like this
 
 361 you'll need to ensure that the directory containing wxPython is
 
 362 contained in the PYTHONPATH environment variable.
</p> 
 366 <div class=
"section"> 
 367 <h1><a id=
"installing-on-os-x" name=
"installing-on-os-x">Installing on OS X
</a></h1> 
 368 <p>Installing wxPython on OS X is nearly the same as the Unix
 
 369 instructions above, except for a few small, but important details:
</p> 
 370 <ol class=
"arabic simple"> 
 371 <li>The --enable-rpath configure option is not needed since the path to
 
 372 the wxWidgets dylibs will automatically be encoded into the
 
 373 extension modules when they are built.  If you end up moving the
 
 374 wxWidgets dynlibs to some other location (such as inside the .app
 
 375 bundle of your applicaiton for distribution to other users,) then
 
 376 you will need to set DYLD_LIBRARY_PATH to this location so the
 
 377 dylibs can be found at runtime.
</li> 
 378 <li>Depending on the version of OS X Python may be installed in
 
 379 different locations.  On 
10.2 (Jaguar) you need to download and
 
 380 install MacPython-OSX-
2.3 from 
<a class=
"reference" href=
"http://www.python.org/">http://www.python.org/
</a> and the
 
 381 Python Framework will then be installed in /Library/Frameworks.  On
 
 382 10.3 (Panther) Apple supplies the Python Framework as part of the
 
 383 OS install, but it will be located in /System/Library/Frameworks
 
 384 instead.  However, on Panther the site-packages dir is sym-linked
 
 385 to /Library/Python/
2.3 so the wxPython packages will end up there,
 
 386 although they will still be visible from site-packages.  If you are
 
 387 building distributions of wxPython to be installed on other
 
 388 machines be careful to install to /Library/Python/
2.3.  To
 
 389 complicate things further, the Jaguar version, or a custom build
 
 390 you do yourself will end up in /Library/Frameworks even on
 
 392 <li>You need to use pythonw at the command line or the PythonLauncher
 
 393 app to run wxPython apps, otherwise the app will not be able to
 
 394 fully use the GUI display.
</li> 
 397 <div class=
"section"> 
 398 <h1><a id=
"installing-on-windows" name=
"installing-on-windows">Installing on Windows
</a></h1> 
 400 <li><p class=
"first">Build wxWidgets and wxPython as described in BUILD.txt.  If you
 
 401 would rather have a version without the code that turns runtime
 
 402 assertions into Python exceptions, then use 
"release
" instead of
 
 403 "hybrid
" when building wxWidgets and add 
"FINAL=
1" to the setup.py
 
 406 <li><p class=
"first">Install wxPython like this.  Remember to add any additional flags
 
 407 you added for the build such as UNICODE or USE_SWIG:
</p> 
 408 <pre class=
"literal-block"> 
 409 python setup.py install
 
 412 <li><p class=
"first">Copy the wxWidgets DLLs to the wx package directory so they can be
 
 413 found at runtime by the extension modules without requiring that
 
 414 they be installed on the PATH:
</p> 
 415 <pre class=
"literal-block"> 
 416 copy %WXWIN%\\lib\\vc_dll\\wx*h_*.dll c:\\Python25\\Lib\\site-packages\\wx