]> git.saurik.com Git - wxWidgets.git/blob - wxPython/docs/INSTALL.txt
Added wxDisplay and wxVideoMode
[wxWidgets.git] / wxPython / docs / INSTALL.txt
1 Installing wxPython 2.5 from Source
2 ===================================
3
4
5 This document will describe the few differences and additions to the
6 content in BUILD.txt for installing wxPython built from source.
7 Please follow the intstructions both in this file and in BUILD.txt to
8 perform this task. Where there is overlap the items described here
9 will take precedence.
10
11
12
13
14 Installing on Unix-like Systems (not OS X)
15 ------------------------------------------
16
17 1. When building wxWidgets you need to decide if you want it to be a
18 private copy only accessed by wxPython, or if you would like it to
19 be installed in a stanard location such as /usr. Or perhaps you
20 already have a version of wxWidgets installed on your system (such
21 as from an RPM) and you want wxPython to use that version too. If
22 so then you'll want to ensure that the flags and options used to
23 build the installed version are compatible with wxPython.
24
25
26 2. If you do decide to build and install your own wxWidgets then there
27 are a few tweaks to the configure flags described in BUILD.txt that
28 you will probably want to make. Instead of --enable-debug use
29 this configure flag::
30
31 --enable-optimize \
32
33 Normally I also use the following flag in order to have wxWidgets
34 runtime assertions turned into Python exceptions where possible.
35 It does add extra code to the build but probably not enough to
36 worry about it. However if you want to get as lean a build as
37 possible you can leave it out, but if your code does something bad
38 then instead of exceptions you'll likely get a crash.
39
40 --enable-debug_flag \
41
42 If you are building a private copy of wxWidgets (IOW, not installed
43 in a standard library location) then it can be kind of a hassle to
44 always have to set the LD_LIBRARY_PATH variable so wxPython can
45 find the wxWidgets shared libraries. You can hard code the library
46 path into the binaries by using the rpath option when configuring
47 wxWidgets. For example::
48
49 --enable-rpath=/opt/wx/2.5/lib \
50
51 SOLARIS NOTE: The --enable-rpath option may cause problems when
52 using wxGTK on Solaris when compiling wxPython as described below.
53 The woraround is to not use --enable-rpath flag for configure, but
54 in that case all wxPython applications *must* have the
55 LD_LIBRARY_PATH set to include $WXPREF/lib, or you can use the
56 'crle' program to modify the runtime linking environment. If this
57 is the only installation of wxGTK on the system then you can use a
58 system library path for prefix and not have to worry about it at
59 all.
60
61
62 3. Build and install wxGTK as described in BUILD.txt.
63
64
65 4. In addition to building wxPython as described in BUILD.txt, you can
66 install it to Python's site-packages dir, as well as some scripts
67 into the same bin dir used by Python by using this command::
68
69 python2.3 setup.py install
70
71 If you would like to install to some place besides the prefix where
72 Python is installed, (such as to your home directory) then you can
73 add "--root=<path>" after the "install" command. This will use
74 <path> as the prefix and will install scripts to a bin subdir and
75 the wxPython packages to a lib subdir. To use wxPython like this
76 you'll need to ensure that the directory containing wxPython is
77 contained in the PYTHONPATH environment variable.
78
79
80
81
82 Installing on OS X
83 ------------------
84
85 Installing wxPython on OS X is nearly the same as the Unix
86 instructions above, except for a few small, but important details:
87
88 1. The --enable-rpath configure option is not needed since the path to
89 the wxWidgets dylibs will automatically be encoded into the
90 extension modules when they are built. If you end up moving the
91 wxWidgets dynlibs to some other location (such as inside the .app
92 bundle of your applicaiton for distribution to other users,) then
93 you will need to set DYLD_LIBRARY_PATH to this location so the
94 dylibs can be found at runtime.
95
96 2. Depending on the version of OS X Python may be installed in
97 different locations. On 10.2 (Jaguar) you need to download and
98 install MacPython-OSX-2.3 from http://www.python.org/ and the
99 Python Framework will then be installed in /Library/Frameworks. On
100 10.3 (Panther) Apple supplies the Python Framework as part of the
101 OS install, but it will be located in /System/Library/Frameworks
102 instead. However, on Panther the site-pacakges dir is sym-linked
103 to /Library/Python/2.3 so the wxPython pacakges will end up there,
104 although they will still be visible from site-packages. If you are
105 building distributions of wxPython to be installed on other
106 machines be careful to install to /Library/Python/2.3. To
107 complicate things further, the Jaguar version, or a custom build
108 you do yourself will end up in /Library/Frameworks even on
109 Panther...
110
111 3. You need to use pythonw at the command line or PythonLauncher app
112 to run wxPython apps, otherwise the app will not be able to fully
113 use the GUI display.
114
115
116
117
118
119 Installing on Windows
120 ---------------------
121
122 1. Build wxWidgets and wxPython as described in BUILD.txt. If you
123 would rather have a version without the code that turns runtime
124 assertions into Python exceptions, then use "release" instead of
125 "hybrid" when building wxWidgets and add "FINAL=1" to the setup.py
126 command line.
127
128 2. Install wxPython like this::
129
130 python setup.py install
131
132
133 3. Copy the wxWidgets DLLs to the wx package directory so they can be
134 found at runtime by the extension modules without requiring that
135 they be installed on the PATH::
136
137 copy %WXWIN%\BIN\wx*h_*.dll c:\Python23\Lib\site-pacakges\wx
138
139