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