blob: 5ff575b5532c5c324d67ddd0307efa32a4617c6b [file] [log] [blame]
Jack Jansen028f2d52001-08-29 22:04:08 +00001How to install Python 2.2a2 on your Macintosh
Jack Jansencbed91b2001-08-03 13:31:36 +00002---------------------------------------------
Jack Jansen2f9a9e32001-02-17 22:03:42 +00003
Jack Jansenc1218bc2001-04-25 22:11:24 +00004This is a MacPython that can run on classic MacOS (from 8.1
Jack Jansencbe7b1c2001-03-06 22:42:12 +00005onwards) and natively on MacOSX. The installer tries to work out whether you can
Jack Jansencbed91b2001-08-03 13:31:36 +00006use the Carbon version or not.
Jack Jansen2f9a9e32001-02-17 22:03:42 +00007
Jack Jansen028f2d52001-08-29 22:04:08 +00008You should definitely read the Relnotes file too, and the section below about
9toolbox module reorganization.
Jack Jansen2f9a9e32001-02-17 22:03:42 +000010
Jack Jansenc1218bc2001-04-25 22:11:24 +000011A special note about the active installer: do not background it, it may hang
Jack Jansen2b73fe92001-03-27 21:38:55 +000012your machine. This is a general problem with Vise active installers, MindVision
13are working on it.
Jack Jansen8ef786e2001-03-15 14:27:09 +000014
Jack Jansen028f2d52001-08-29 22:04:08 +000015Aside from the general new Python 2.2a2 listed in the general relnotes file
16there is some other new machine-independent stuff in this release as well, as
17it was built from newer sources than unix/windows 2.2a2.
Jack Jansen2f9a9e32001-02-17 22:03:42 +000018------
Jack Jansen83cab721997-08-26 13:25:06 +000019
20If this is your first encounter with Python: you definitely need the
21common user documentation (common to all platforms). You can find this
Jack Jansen538bd132000-10-19 21:58:27 +000022(in various forms) on www.pythonlabs.com, www.python.org and
23ftp.python.org. Through there, or via
24http://www.cwi.nl/~jack/macpython.html you can also find the most recent
25MacPython distribution.
Jack Jansen83cab721997-08-26 13:25:06 +000026
27Mac-specific documentation is included in this distribution in folder
28Mac:Demo. The documentation is sparse, but it will have to serve for
29now. The documentation is in HTML format, start with index.html.
30
Jack Jansencbe7b1c2001-03-06 22:42:12 +000031This installer installs MacPython for classic PPC MacOS, MacPython for Carbon
32(OS X, OS 9 or OS8 with CarbonLib installed) or both, depending on your
33configuration. By selecting custom install you can bypass these tests and
34install what you want.
Jack Jansenecbc1cc1998-01-06 12:13:16 +000035
Jack Jansen2b73fe92001-03-27 21:38:55 +000036If you want 68k support you will have to stay with MacPython 1.5.2.
Jack Jansen965226b2000-09-14 20:58:24 +000037
Jack Jansen028f2d52001-08-29 22:04:08 +000038Toolbox module reorganization and more
39--------------------------------------
40
41You can safely skip this section if this is your first encounter with MacPython.
42
43I am working on a new organization of the mac-specific modules, and in
44general bringing the MacPython folder structure more in line with
45unix-Python. This is not only a good idea, it will also immensely
46facilitate moving MacPython functionality to an OSX Python that is based
47on Mach-O and the unix-Python distribution. But don't worry: MacPython
48is definitely not dead yet, and the hope is that the transition will be
49as seamless as possible.
50
51First a change that should not cause too much concern: :Mac:Plugins has
52gone, and most of the dynamically loaded modules have moved to
53:Lib:lib-dynload.
54
55Second, and more important: the toolbox modules, such as Res and
56Resource, have moved to a Carbon package. So, in stead of "import Res"
57you should now say "from Carbon import Res" and in stead of "from Res
58import *" you should use "from Carbon.Res import *". For the lifetime of
59MacPython 2.2 there is a folder :Mac:Lib:lib-compat on sys.path that
60contains modules with the old names which imports the new names after
61issuing a warning.
62
63Note that although the package is called Carbon the modules work fine under
64classic PPC, and they are normal classic modules. Also note that some
65modules you may think of as toolbox modules (such as Waste) really are not,
66and they are not in the Carbon package.
67
68Some open issues I would like to discuss on the PythonMac-SIG, please join
69in if you have views on the matter:
70- Is this all a good idea?
71- Some modules are not in the Carbon package (icglue, for instance, or
72 supporting module such as aetools and aepack) and maybe they should be,
73 some are (ControlAccessors) which arguably should not. Opinions are welcome.
74- I'm tempted to put Qt and QuickTime into their own package, especially
75 since I'm also working on porting it to Windows. It would also be in line
76 with Apple's organization. Opinions?
77- Should we get rid of the Res/Resource dichotomy, where the first is the
78 extension module and the second is the Python module with the constants?
79 We could simply import the extension module functionality into the Python
80 module, at the expense of a rather large namespace.
81- Should we have a Carbon.Carbon module that simply imports the whole world,
82 so that "from Carbon.Carbon import *" is pretty much equivalent to the C
83 #include <Carbon/Carbon.h>?
84- Should we put all the other Mac modules into a Mac package? This will make
85 MacPython programs a lot more verbose, but that is a good thing too if people
86 try to port Mac Python scripts to other platforms.
87 Should the Carbon package then be a sub-package of the Mac package?
88
89Another change related to the OSX growth path is that there is a new module
90macresource that you can use to easily open a resource file accompanying your
91script. Use "macresource.need("DLOG", MY_DIALOG_ID, "name.rsrc") and if the
92given resource is not available (it _is_ available if your script has been
93turned into an applet) the given resource file will be opened. This method will
94eventually also contain the magic needed to open the resource file on
95OSX MachO Python.
96
97... and more
98------------
99
100A feature that I am not sure about (so: feedback!) is that if you open a textfile
101for reading MacPython will now accept either unix linefeeds (LF, '\n') or
102Macintosh linefeeds (CR, '\r') and present both of them as '\n'. This is done on
103a low level, so it works for files opened by scripts as well as for your scripts
104and modules itself.
105
106But:
107- this works only for input, and there's no way to find out what the original
108 linefeed convention of the file was.
109- this is unconditional, so there's no way to turn it off, either on a file-by-file
110 basis or globally (but opening binary files works as it always has, of course).
111- Windows \r\n linefeeds are not supported and get turned into \n\n.
112
Jack Jansen83cab721997-08-26 13:25:06 +0000113What to install
114---------------
115
Jack Jansen12a37b72000-05-06 23:01:07 +0000116The optional parts in this distribution are
117- TK+PIL: Tkinter and support modules, plus Imaging, the Python image manipulation
118 package (allows you to read, write and display images and do lots of operations on them).
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000119 For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet.
Jack Jansen2b73fe92001-03-27 21:38:55 +0000120 This is the reason Classic MacPython is also installed on MacOSX: it allows you
Jack Jansen028f2d52001-08-29 22:04:08 +0000121 to run Tkinter applications, albeit in the Classic box.
Jack Jansen12a37b72000-05-06 23:01:07 +0000122- img: another imaging package. Has more file format support and is faster
123 than imaging, but has only limited operations on images. There is a bridge
124 between the packages.
125- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000126 on matrices and such. This is the most recent version from the sourceforge archive.
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000127 Numeric has moved from Extensions to :Lib:site-python, by the way, see the release
128 notes.
Jack Jansen12a37b72000-05-06 23:01:07 +0000129- Developers kit: all header files and some tools and sample projects to get you started on
130 writing Python extensions if you have CodeWarrior.
131All these except the DevKit are installed with Easy Install.
Jack Jansen83cab721997-08-26 13:25:06 +0000132
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000133After the installer finishes it automatically launches the appropriate
Jack Jansen2b73fe92001-03-27 21:38:55 +0000134ConfigurePython applet, to finish configuration of your Python. If you run MacOS9 or later
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000135(or 8 with CarbonLib installed) you can switch back and forth between the classic and
136Carbon versions of Python by running either ConfigurePythonClassic or ConfigurePythonCarbon.
Jack Jansen83cab721997-08-26 13:25:06 +0000137
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000138Moving your Python installation after installing is generally not a good idea.
139If you have to do this anyway you should remove your preference file, run
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000140ConfigurePython and remove all .pyc files. (there's a script zappyc.py that does
141the latter).
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000142
Jack Jansen83cab721997-08-26 13:25:06 +0000143If you don't have enough memory: the sizes choosen are somewhat
Jack Jansen9080e9b2001-01-23 21:03:52 +0000144arbitrary, and they are as high as they are so that test.autotest runs with fewer
145problems. An average Python program can make do with much less memory.
146Try lowering the application sizes in the finder "get info"
147window, and seeing whether the resulting python is still usable.
Jack Jansen83cab721997-08-26 13:25:06 +0000148
Jack Jansen83cab721997-08-26 13:25:06 +0000149After installing
150----------------
151
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000152It is probably a good idea to run the automatic tests. Start
Jack Jansende519092000-10-12 21:21:43 +0000153Python and "import test.autotest".
154
Jack Jansencbed91b2001-08-03 13:31:36 +0000155Three tests will fail on MacOS9, all with MemoryErrors:
156test_longexp, test_sha and test_zlib (on MacOSX nothing should fail).
Jack Jansen2b73fe92001-03-27 21:38:55 +0000157
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000158If you increase the PythonInterpreter memory
Jack Jansen2b73fe92001-03-27 21:38:55 +0000159partition size they will pass (but for longexp you have to increase it by an
Jack Jansen99e607a2001-05-10 12:20:30 +0000160incredible amount, 400MB is rumoured). It will, however, print some messages
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000161about optional features not supported. You should not worry about these,
162they are modules that are supported by Python on other platforms. Also,
163if you didn't run compileall before autotesting you may run out of
164memory the first time you run the tests. test_socket may also fail if
165you have no internet connection. Please also read the Relnotes file for
166other minor problems with this distribution.
Jack Jansen83cab721997-08-26 13:25:06 +0000167
Jack Jansen12a37b72000-05-06 23:01:07 +0000168Using Python is most easily done from the IDE, which has a builtin editor,
169debugger and other goodies. The alternative is to use PythonInterpreter,
170which is the lowlevel interpreter with a console-window only (similar to Unix
171Python).
Jack Jansen83cab721997-08-26 13:25:06 +0000172
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000173If your program uses Tkinter you MUST run it under PythonInterpreter, Tkinter
174and IDE are incompatible and your program will fail in strange ways.
175
Jack Jansen0b726951997-10-08 15:34:42 +0000176Uninstalling
177------------
178
179Two items are installed in the system folder: the interpreter shared
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000180libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the
Jack Jansen028f2d52001-08-29 22:04:08 +0000181"Python 2.2a2 Preferences" file in the Python subfolder in the
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000182Preferences folder. All the rest of Python lives in the folder you
183installed in.
Jack Jansen0b726951997-10-08 15:34:42 +0000184
Jack Jansenc1218bc2001-04-25 22:11:24 +0000185On OSX the libraries are installed in /Library/CFMSupport. There is a nasty bug
186in OSX that is triggered by Python: if any orphaned aliases are left in
187/Library/CFMSupport your machine will start to behave very badly. 2.1
188beta installers triggered this problem if you simply threw away your Python folder,
189so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport
Jack Jansen028f2d52001-08-29 22:04:08 +0000190too. The final 2.1 and 2.1.1 installers always copied the shared libraries on OSX, so it does
Jack Jansenc1218bc2001-04-25 22:11:24 +0000191not have the problem anymore.
192
Jack Jansen83cab721997-08-26 13:25:06 +0000193Things to see
194-------------
195
Jack Jansen12a37b72000-05-06 23:01:07 +0000196Start off at Mac:Demo:index.html. Read at least the first few sections.
197
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000198There are also some interesting files in the "Relnotes" folder that may
Jack Jansen83cab721997-08-26 13:25:06 +0000199contain useful information. There is also a first stab at documentation
200(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
Jack Jansen12a37b72000-05-06 23:01:07 +0000201machine-independent demos.
202The Mac:Lib:test folder also has some programs that show simple
Jack Jansen83cab721997-08-26 13:25:06 +0000203capabilities of various modules.
204
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000205The ":Mac:scripts" folder has some sample scripts. Some are useful, some are
Jack Jansen83cab721997-08-26 13:25:06 +0000206just interesting to look at to see how various things work. The MkDistr,
207mkapplet and fullbuild scripts (plus the ones mentioned above) may help
208you to understand how to use AppleEvents and various other toolboxes
209from python.
210
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000211Other mac-specific goodies can be found in :Mac:Tools, of which the IDE sources
212and a CGI framework deserve special mention.
213
Jack Jansen83cab721997-08-26 13:25:06 +0000214The 'img' group of modules, which handles I/O of many different image
Jack Jansend0ddb661998-04-27 15:14:36 +0000215formats is included, but without documentation. You can find docs at
216ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
217
218Finally there is a Mac:Contrib folder which contains some contributed
Jack Jansen12a37b72000-05-06 23:01:07 +0000219software.
Jack Jansen83cab721997-08-26 13:25:06 +0000220
221Upgrading from older Python releases
222------------------------------------
223
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000224Python releases are independent of each other, with
Jack Jansen83cab721997-08-26 13:25:06 +0000225separate Preferences files, shared library names, etc. The good news is
226that this means you can keep your older version around if you are unsure
227whether to upgrade. The bad news is that your old preference settings
228are lost and you have to set them again.
229
Jack Jansen028f2d52001-08-29 22:04:08 +0000230After you are satisfied that 2.2a2 works as expected you can trash
Jack Jansen83cab721997-08-26 13:25:06 +0000231anything in the system folder that has "python" in the name and not
Jack Jansen028f2d52001-08-29 22:04:08 +0000232"2.2a2".
Jack Jansen83cab721997-08-26 13:25:06 +0000233
Jack Jansen028f2d52001-08-29 22:04:08 +0000234The ConfigurePython... applets will try to detect incompatible preferences
Jack Jansen2b73fe92001-03-27 21:38:55 +0000235files and offer to remove them. This means that re-running ConfigurePython after
236a second install of the same MacPython version (or after moving the Python folder)
237should fix things up correctly.
238
Jack Jansen83cab721997-08-26 13:25:06 +0000239The installer
240-------------
241
Jack Jansen12a37b72000-05-06 23:01:07 +0000242The installer for this product was created using Installer VISE
243from MindVision Software. For more information on Installer VISE,
Jack Jansen83cab721997-08-26 13:25:06 +0000244contact:
245MindVision Software
2467201 North 7th Street
247Lincoln, NE 68521-8913
248Voice: 402-477-3269
249Fax: 402-477-1395
250Internet: mindvision@mindvision.com
251http://www.mindvision.com
252
Jack Jansen12a37b72000-05-06 23:01:07 +0000253Just van Rossum <just@letterror.nl> created the initial version of the
254installer (with Installer Vise Lite), and Jack worked from there.
Jack Jansen83cab721997-08-26 13:25:06 +0000255
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000256Thanks!
257-------
258
Jack Jansen965226b2000-09-14 20:58:24 +0000259Thanks go to the whole Python community with Guido in the lead, of
260course. Mac-specific thanks go to the pythonmac-sig, Just van Rossum,
261Corran Webster, Tony Ingraldi, Erik van Blokland, Bill Bedford, Chris
262Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David
Jack Jansen538bd132000-10-19 21:58:27 +0000263Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn,
Jack Jansende1d4952001-08-27 15:30:48 +0000264Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer
265and all the other people who provided feedback, code or both!
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000266
Jack Jansende519092000-10-12 21:21:43 +0000267MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli.
268
Jack Jansen9080e9b2001-01-23 21:03:52 +0000269A special mention is deserved by Matthias Neeracher, who has written the brilliant
270unix-compatible GUSI I/O library, without which MacPython would not have sockets
271or select, and to Alexandre Parenteau, who has ported this library to Carbon.
272
Jack Jansen83cab721997-08-26 13:25:06 +0000273Feedback
274--------
275
276Send bug reports, suggestions, contributions and fanmail to
Jack Jansenecbc1cc1998-01-06 12:13:16 +0000277<jack@cwi.nl>. However, a better way to discuss MacPython is to join the
Jack Jansen83cab721997-08-26 13:25:06 +0000278<pythonmac-sig@python.org> mailing list, which is explicitly meant for
279this purpose.
280
Jack Jansenb25ec912001-03-05 15:44:55 +0000281
Jack Jansen83cab721997-08-26 13:25:06 +0000282Jack Jansen
Jack Jansen12a37b72000-05-06 23:01:07 +0000283Oratrix Development BV
284Valeriusplein 30
285Amsterdam
Jack Jansen83cab721997-08-26 13:25:06 +0000286the Netherlands
287
288<jack@cwi.nl>, http://www.cwi.nl/~jack