blob: 0628b55f85119421d62f46263106ffc8d69b3e9c [file] [log] [blame]
Jack Jansen5d528b72001-10-23 22:22:09 +00001How to install Python 2.2b1 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
Jack Jansen5d528b72001-10-23 22:22:09 +00009toolbox module reorganization. You should also read :Misc:NEWS, which lists
10the general (non-mac-dependent) new features of this Python release.
Jack Jansen2f9a9e32001-02-17 22:03:42 +000011
Jack Jansenc1218bc2001-04-25 22:11:24 +000012A special note about the active installer: do not background it, it may hang
Jack Jansen2b73fe92001-03-27 21:38:55 +000013your machine. This is a general problem with Vise active installers, MindVision
14are working on it.
Jack Jansen8ef786e2001-03-15 14:27:09 +000015
Jack Jansen2f9a9e32001-02-17 22:03:42 +000016------
Jack Jansen83cab721997-08-26 13:25:06 +000017
18If this is your first encounter with Python: you definitely need the
19common user documentation (common to all platforms). You can find this
Jack Jansen538bd132000-10-19 21:58:27 +000020(in various forms) on www.pythonlabs.com, www.python.org and
21ftp.python.org. Through there, or via
22http://www.cwi.nl/~jack/macpython.html you can also find the most recent
23MacPython distribution.
Jack Jansen83cab721997-08-26 13:25:06 +000024
25Mac-specific documentation is included in this distribution in folder
26Mac:Demo. The documentation is sparse, but it will have to serve for
27now. The documentation is in HTML format, start with index.html.
28
Jack Jansencbe7b1c2001-03-06 22:42:12 +000029This installer installs MacPython for classic PPC MacOS, MacPython for Carbon
30(OS X, OS 9 or OS8 with CarbonLib installed) or both, depending on your
31configuration. By selecting custom install you can bypass these tests and
32install what you want.
Jack Jansenecbc1cc1998-01-06 12:13:16 +000033
Jack Jansen2b73fe92001-03-27 21:38:55 +000034If you want 68k support you will have to stay with MacPython 1.5.2.
Jack Jansen965226b2000-09-14 20:58:24 +000035
Jack Jansen028f2d52001-08-29 22:04:08 +000036Toolbox module reorganization and more
37--------------------------------------
38
39You can safely skip this section if this is your first encounter with MacPython.
40
41I am working on a new organization of the mac-specific modules, and in
42general bringing the MacPython folder structure more in line with
43unix-Python. This is not only a good idea, it will also immensely
44facilitate moving MacPython functionality to an OSX Python that is based
45on Mach-O and the unix-Python distribution. But don't worry: MacPython
46is definitely not dead yet, and the hope is that the transition will be
47as seamless as possible.
48
49First a change that should not cause too much concern: :Mac:Plugins has
50gone, and most of the dynamically loaded modules have moved to
51:Lib:lib-dynload.
52
53Second, and more important: the toolbox modules, such as Res and
54Resource, have moved to a Carbon package. So, in stead of "import Res"
55you should now say "from Carbon import Res" and in stead of "from Res
56import *" you should use "from Carbon.Res import *". For the lifetime of
57MacPython 2.2 there is a folder :Mac:Lib:lib-compat on sys.path that
58contains modules with the old names which imports the new names after
59issuing a warning.
60
61Note that although the package is called Carbon the modules work fine under
62classic PPC, and they are normal classic modules. Also note that some
63modules you may think of as toolbox modules (such as Waste) really are not,
64and they are not in the Carbon package.
Jack Jansen028f2d52001-08-29 22:04:08 +000065
66Another change related to the OSX growth path is that there is a new module
67macresource that you can use to easily open a resource file accompanying your
68script. Use "macresource.need("DLOG", MY_DIALOG_ID, "name.rsrc") and if the
69given resource is not available (it _is_ available if your script has been
70turned into an applet) the given resource file will be opened. This method will
71eventually also contain the magic needed to open the resource file on
72OSX MachO Python.
73
Jack Jansen5d528b72001-10-23 22:22:09 +000074Another feature to help with the OSX transition is that if you open a textfile
Jack Jansen028f2d52001-08-29 22:04:08 +000075for reading MacPython will now accept either unix linefeeds (LF, '\n') or
76Macintosh linefeeds (CR, '\r') and present both of them as '\n'. This is done on
77a low level, so it works for files opened by scripts as well as for your scripts
Jack Jansenf7e57142001-09-08 21:38:26 +000078and modules itself. This can be turned off with a preference/startup option.
Jack Jansen028f2d52001-08-29 22:04:08 +000079
80But:
81- this works only for input, and there's no way to find out what the original
82 linefeed convention of the file was.
Jack Jansen028f2d52001-08-29 22:04:08 +000083- Windows \r\n linefeeds are not supported and get turned into \n\n.
84
Jack Jansen83cab721997-08-26 13:25:06 +000085What to install
86---------------
87
Jack Jansen12a37b72000-05-06 23:01:07 +000088The optional parts in this distribution are
89- TK+PIL: Tkinter and support modules, plus Imaging, the Python image manipulation
90 package (allows you to read, write and display images and do lots of operations on them).
Jack Jansencbe7b1c2001-03-06 22:42:12 +000091 For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet.
Jack Jansen2b73fe92001-03-27 21:38:55 +000092 This is the reason Classic MacPython is also installed on MacOSX: it allows you
Jack Jansen028f2d52001-08-29 22:04:08 +000093 to run Tkinter applications, albeit in the Classic box.
Jack Jansen12a37b72000-05-06 23:01:07 +000094- img: another imaging package. Has more file format support and is faster
95 than imaging, but has only limited operations on images. There is a bridge
96 between the packages.
97- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
Jack Jansen8a6cdcc2000-09-10 12:02:28 +000098 on matrices and such. This is the most recent version from the sourceforge archive.
Jack Jansencbe7b1c2001-03-06 22:42:12 +000099 Numeric has moved from Extensions to :Lib:site-python, by the way, see the release
100 notes.
Jack Jansen12a37b72000-05-06 23:01:07 +0000101- Developers kit: all header files and some tools and sample projects to get you started on
102 writing Python extensions if you have CodeWarrior.
103All these except the DevKit are installed with Easy Install.
Jack Jansen83cab721997-08-26 13:25:06 +0000104
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000105After the installer finishes it automatically launches the appropriate
Jack Jansen2b73fe92001-03-27 21:38:55 +0000106ConfigurePython applet, to finish configuration of your Python. If you run MacOS9 or later
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000107(or 8 with CarbonLib installed) you can switch back and forth between the classic and
108Carbon versions of Python by running either ConfigurePythonClassic or ConfigurePythonCarbon.
Jack Jansen83cab721997-08-26 13:25:06 +0000109
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000110Moving your Python installation after installing is generally not a good idea.
111If you have to do this anyway you should remove your preference file, run
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000112ConfigurePython and remove all .pyc files. (there's a script zappyc.py that does
113the latter).
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000114
Jack Jansen83cab721997-08-26 13:25:06 +0000115If you don't have enough memory: the sizes choosen are somewhat
Jack Jansen9080e9b2001-01-23 21:03:52 +0000116arbitrary, and they are as high as they are so that test.autotest runs with fewer
117problems. An average Python program can make do with much less memory.
118Try lowering the application sizes in the finder "get info"
119window, and seeing whether the resulting python is still usable.
Jack Jansen83cab721997-08-26 13:25:06 +0000120
Jack Jansen83cab721997-08-26 13:25:06 +0000121After installing
122----------------
123
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000124It is probably a good idea to run the automatic tests. Start
Jack Jansenf7e57142001-09-08 21:38:26 +0000125Python and "import test.regrtest ; test.regrtest.main()".
Jack Jansende519092000-10-12 21:21:43 +0000126
Jack Jansenf7e57142001-09-08 21:38:26 +0000127test_time will fail because MacPython accepts bogus values for mktime(), this
Jack Jansen5d528b72001-10-23 22:22:09 +0000128will be fixed later (it is not a very serious problem).
Jack Jansenf7e57142001-09-08 21:38:26 +0000129
130test_descrtut will fail because of a problem with the test itself.
131
132Three tests will fail on MacOS9 with MemoryErrors:
Jack Jansen5d528b72001-10-23 22:22:09 +0000133test_longexp, test_sha and test_zlib (on MacOSX these should pass).
Jack Jansen2b73fe92001-03-27 21:38:55 +0000134
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000135If you increase the PythonInterpreter memory
Jack Jansen2b73fe92001-03-27 21:38:55 +0000136partition size they will pass (but for longexp you have to increase it by an
Jack Jansen99e607a2001-05-10 12:20:30 +0000137incredible amount, 400MB is rumoured). It will, however, print some messages
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000138about optional features not supported. You should not worry about these,
139they are modules that are supported by Python on other platforms. Also,
140if you didn't run compileall before autotesting you may run out of
141memory the first time you run the tests. test_socket may also fail if
142you have no internet connection. Please also read the Relnotes file for
143other minor problems with this distribution.
Jack Jansen83cab721997-08-26 13:25:06 +0000144
Jack Jansen12a37b72000-05-06 23:01:07 +0000145Using Python is most easily done from the IDE, which has a builtin editor,
146debugger and other goodies. The alternative is to use PythonInterpreter,
147which is the lowlevel interpreter with a console-window only (similar to Unix
148Python).
Jack Jansen83cab721997-08-26 13:25:06 +0000149
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000150If your program uses Tkinter you MUST run it under PythonInterpreter, Tkinter
151and IDE are incompatible and your program will fail in strange ways.
152
Jack Jansen0b726951997-10-08 15:34:42 +0000153Uninstalling
154------------
155
156Two items are installed in the system folder: the interpreter shared
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000157libraries PythonCore and PythonCoreCarbon lives in the Extensions folder and the
Jack Jansen5d528b72001-10-23 22:22:09 +0000158"Python 2.2b1 Preferences" file in the Python subfolder in the
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000159Preferences folder. All the rest of Python lives in the folder you
160installed in.
Jack Jansen0b726951997-10-08 15:34:42 +0000161
Jack Jansenc1218bc2001-04-25 22:11:24 +0000162On OSX the libraries are installed in /Library/CFMSupport. There is a nasty bug
163in OSX that is triggered by Python: if any orphaned aliases are left in
164/Library/CFMSupport your machine will start to behave very badly. 2.1
165beta installers triggered this problem if you simply threw away your Python folder,
166so if you installed a 2.1beta you should clean out the aliases in /Library/CFMSupport
Jack Jansen028f2d52001-08-29 22:04:08 +0000167too. 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 +0000168not have the problem anymore.
169
Jack Jansen83cab721997-08-26 13:25:06 +0000170Things to see
171-------------
172
Jack Jansen12a37b72000-05-06 23:01:07 +0000173Start off at Mac:Demo:index.html. Read at least the first few sections.
174
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000175There are also some interesting files in the "Relnotes" folder that may
Jack Jansen83cab721997-08-26 13:25:06 +0000176contain useful information. There is also a first stab at documentation
177(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
Jack Jansen12a37b72000-05-06 23:01:07 +0000178machine-independent demos.
179The Mac:Lib:test folder also has some programs that show simple
Jack Jansen83cab721997-08-26 13:25:06 +0000180capabilities of various modules.
181
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000182The ":Mac:scripts" folder has some sample scripts. Some are useful, some are
Jack Jansen83cab721997-08-26 13:25:06 +0000183just interesting to look at to see how various things work. The MkDistr,
184mkapplet and fullbuild scripts (plus the ones mentioned above) may help
185you to understand how to use AppleEvents and various other toolboxes
186from python.
187
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000188Other mac-specific goodies can be found in :Mac:Tools, of which the IDE sources
189and a CGI framework deserve special mention.
190
Jack Jansen83cab721997-08-26 13:25:06 +0000191The 'img' group of modules, which handles I/O of many different image
Jack Jansend0ddb661998-04-27 15:14:36 +0000192formats is included, but without documentation. You can find docs at
193ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
194
195Finally there is a Mac:Contrib folder which contains some contributed
Jack Jansen12a37b72000-05-06 23:01:07 +0000196software.
Jack Jansen83cab721997-08-26 13:25:06 +0000197
198Upgrading from older Python releases
199------------------------------------
200
Jack Jansen2f9a9e32001-02-17 22:03:42 +0000201Python releases are independent of each other, with
Jack Jansen83cab721997-08-26 13:25:06 +0000202separate Preferences files, shared library names, etc. The good news is
203that this means you can keep your older version around if you are unsure
204whether to upgrade. The bad news is that your old preference settings
205are lost and you have to set them again.
206
Jack Jansen5d528b72001-10-23 22:22:09 +0000207After you are satisfied that 2.2b1 works as expected you can trash
Jack Jansen83cab721997-08-26 13:25:06 +0000208anything in the system folder that has "python" in the name and not
Jack Jansen5d528b72001-10-23 22:22:09 +0000209"2.2b1".
Jack Jansen83cab721997-08-26 13:25:06 +0000210
Jack Jansen028f2d52001-08-29 22:04:08 +0000211The ConfigurePython... applets will try to detect incompatible preferences
Jack Jansen2b73fe92001-03-27 21:38:55 +0000212files and offer to remove them. This means that re-running ConfigurePython after
213a second install of the same MacPython version (or after moving the Python folder)
214should fix things up correctly.
215
Jack Jansen83cab721997-08-26 13:25:06 +0000216The installer
217-------------
218
Jack Jansen12a37b72000-05-06 23:01:07 +0000219The installer for this product was created using Installer VISE
220from MindVision Software. For more information on Installer VISE,
Jack Jansen83cab721997-08-26 13:25:06 +0000221contact:
222MindVision Software
2237201 North 7th Street
224Lincoln, NE 68521-8913
225Voice: 402-477-3269
226Fax: 402-477-1395
227Internet: mindvision@mindvision.com
228http://www.mindvision.com
229
Jack Jansen12a37b72000-05-06 23:01:07 +0000230Just van Rossum <just@letterror.nl> created the initial version of the
231installer (with Installer Vise Lite), and Jack worked from there.
Jack Jansen83cab721997-08-26 13:25:06 +0000232
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000233Thanks!
234-------
235
Jack Jansen965226b2000-09-14 20:58:24 +0000236Thanks go to the whole Python community with Guido in the lead, of
237course. Mac-specific thanks go to the pythonmac-sig, Just van Rossum,
238Corran Webster, Tony Ingraldi, Erik van Blokland, Bill Bedford, Chris
239Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David
Jack Jansen538bd132000-10-19 21:58:27 +0000240Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn,
Jack Jansenf7e57142001-09-08 21:38:26 +0000241Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer,
242Alexandre Parenteau,
Jack Jansende1d4952001-08-27 15:30:48 +0000243and all the other people who provided feedback, code or both!
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000244
Jack Jansende519092000-10-12 21:21:43 +0000245MacPython includes waste, a TextEdit replacement which is (c) 1998 Marco Piovanelli.
246
Jack Jansen9080e9b2001-01-23 21:03:52 +0000247A special mention is deserved by Matthias Neeracher, who has written the brilliant
248unix-compatible GUSI I/O library, without which MacPython would not have sockets
249or select, and to Alexandre Parenteau, who has ported this library to Carbon.
250
Jack Jansen83cab721997-08-26 13:25:06 +0000251Feedback
252--------
253
254Send bug reports, suggestions, contributions and fanmail to
Jack Jansenecbc1cc1998-01-06 12:13:16 +0000255<jack@cwi.nl>. However, a better way to discuss MacPython is to join the
Jack Jansen83cab721997-08-26 13:25:06 +0000256<pythonmac-sig@python.org> mailing list, which is explicitly meant for
257this purpose.
258
Jack Jansenb25ec912001-03-05 15:44:55 +0000259
Jack Jansen83cab721997-08-26 13:25:06 +0000260Jack Jansen
Jack Jansen12a37b72000-05-06 23:01:07 +0000261Oratrix Development BV
262Valeriusplein 30
263Amsterdam
Jack Jansen83cab721997-08-26 13:25:06 +0000264the Netherlands
265
266<jack@cwi.nl>, http://www.cwi.nl/~jack