blob: 79a94ad5d349721d77b5aa56f4147f493590bf0f [file] [log] [blame]
Jack Jansenb3be2162001-11-30 14:16:36 +00001How to install Python 2.2b2 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 Jansen1a29ed72001-10-31 10:13:52 +000074Another feature to help with the OSX transition is that if you open a
75textfile for reading MacPython will now accept either unix linefeeds
76(LF, '\n') or Macintosh linefeeds (CR, '\r') and present both of them
77as '\n'. This is done on a low level, so it works for files opened by
78scripts as well as for your scripts and modules itself. This can be
79turned off with a preference/startup option.
Jack Jansen028f2d52001-08-29 22:04:08 +000080
81But:
82- this works only for input, and there's no way to find out what the original
83 linefeed convention of the file was.
Jack Jansen028f2d52001-08-29 22:04:08 +000084- Windows \r\n linefeeds are not supported and get turned into \n\n.
85
Jack Jansen83cab721997-08-26 13:25:06 +000086What to install
87---------------
88
Jack Jansen12a37b72000-05-06 23:01:07 +000089The optional parts in this distribution are
Jack Jansen1a29ed72001-10-31 10:13:52 +000090- TK+PIL: Tkinter and support modules, plus Imaging, the Python image
91 manipulation package (allows you to read, write and display images and
92 do lots of operations on them).
Jack Jansencbe7b1c2001-03-06 22:42:12 +000093 For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet.
Jack Jansen1a29ed72001-10-31 10:13:52 +000094 This is the reason Classic MacPython is also installed on MacOSX: it
95 allows you to run Tkinter applications, albeit in the Classic box.
Jack Jansen12a37b72000-05-06 23:01:07 +000096- img: another imaging package. Has more file format support and is faster
97 than imaging, but has only limited operations on images. There is a bridge
98 between the packages.
99- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
Jack Jansen1a29ed72001-10-31 10:13:52 +0000100 on matrices and such. This is the most recent version from the
101 sourceforge archive.
102 Numeric has moved from Extensions to :Lib:site-python, by the way,
103 see the release notes.
104- Developers kit: all header files and some tools and sample projects
105 to get you started on writing Python extensions if you have CodeWarrior.
Jack Jansen12a37b72000-05-06 23:01:07 +0000106All these except the DevKit are installed with Easy Install.
Jack Jansen83cab721997-08-26 13:25:06 +0000107
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000108After the installer finishes it automatically launches the appropriate
Jack Jansen1a29ed72001-10-31 10:13:52 +0000109ConfigurePython applet, to finish configuration of your Python. If you
110run MacOS9 or later (or 8 with CarbonLib installed) you can switch
111back and forth between the classic and Carbon versions of Python by
112running either ConfigurePythonClassic or ConfigurePythonCarbon.
Jack Jansen83cab721997-08-26 13:25:06 +0000113
Jack Jansen1a29ed72001-10-31 10:13:52 +0000114Moving your Python installation after installing is generally not a
115good idea. If you have to do this anyway you should remove your
116preference file, run ConfigurePython and remove all .pyc
117files. (there's a script zappyc.py that does the latter).
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000118
Jack Jansen83cab721997-08-26 13:25:06 +0000119If you don't have enough memory: the sizes choosen are somewhat
Jack Jansen1a29ed72001-10-31 10:13:52 +0000120arbitrary, and they are as high as they are so that test.autotest runs
121with fewer problems. An average Python program can make do with much
122less memory. Try lowering the application sizes in the finder "get
123info" window, and seeing whether the resulting python is still usable.
Jack Jansen83cab721997-08-26 13:25:06 +0000124
Jack Jansen83cab721997-08-26 13:25:06 +0000125After installing
126----------------
127
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000128It is probably a good idea to run the automatic tests. Start
Jack Jansenf7e57142001-09-08 21:38:26 +0000129Python and "import test.regrtest ; test.regrtest.main()".
Jack Jansende519092000-10-12 21:21:43 +0000130
Jack Jansenb3be2162001-11-30 14:16:36 +0000131test_frozen will fail in MacPython because of different handling on
132frozen modules. This should not be a problem in normal use.
133
Jack Jansen1a29ed72001-10-31 10:13:52 +0000134test_time will fail because MacPython accepts bogus values for
135mktime(), this will be fixed later (it is not a very serious problem).
Jack Jansenf7e57142001-09-08 21:38:26 +0000136
Jack Jansenf7e57142001-09-08 21:38:26 +0000137Three tests will fail on MacOS9 with MemoryErrors:
Jack Jansen5d528b72001-10-23 22:22:09 +0000138test_longexp, test_sha and test_zlib (on MacOSX these should pass).
Jack Jansen2b73fe92001-03-27 21:38:55 +0000139
Jack Jansen1a29ed72001-10-31 10:13:52 +0000140If you increase the PythonInterpreter memory partition size they will
141pass (but for longexp you have to increase it by an incredible amount,
142400MB is rumoured). It will, however, print some messages about
143optional features not supported. You should not worry about these,
144they are modules that are supported by Python on other
145platforms. Also, if you didn't run compileall before autotesting you
146may run out of memory the first time you run the tests. test_socket
147may also fail if you have no internet connection. Please also read the
148Relnotes file for other minor problems with this distribution.
Jack Jansen83cab721997-08-26 13:25:06 +0000149
Jack Jansen1a29ed72001-10-31 10:13:52 +0000150Using Python is most easily done from the IDE, which has a builtin
151editor, debugger and other goodies. The alternative is to use
152PythonInterpreter, which is the lowlevel interpreter with a
153console-window only (similar to Unix Python).
Jack Jansen83cab721997-08-26 13:25:06 +0000154
Jack Jansen1a29ed72001-10-31 10:13:52 +0000155If your program uses Tkinter you MUST run it under PythonInterpreter,
156Tkinter and IDE are incompatible and your program will fail in strange
157ways.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000158
Jack Jansen0b726951997-10-08 15:34:42 +0000159Uninstalling
160------------
161
162Two items are installed in the system folder: the interpreter shared
Jack Jansen1a29ed72001-10-31 10:13:52 +0000163libraries PythonCore and PythonCoreCarbon lives in the Extensions
Jack Jansenb3be2162001-11-30 14:16:36 +0000164folder and the "Python 2.2b2 Preferences" file in the Python subfolder
Jack Jansen1a29ed72001-10-31 10:13:52 +0000165in the Preferences folder. All the rest of Python lives in the folder
166you installed in.
Jack Jansen0b726951997-10-08 15:34:42 +0000167
Jack Jansen1a29ed72001-10-31 10:13:52 +0000168On OSX the libraries are installed in /Library/CFMSupport. There is a
169nasty bug in OSX that is triggered by Python: if any orphaned aliases
170are left in /Library/CFMSupport your machine will start to behave very
171badly. 2.1 beta installers triggered this problem if you simply threw
172away your Python folder, so if you installed a 2.1beta you should
173clean out the aliases in /Library/CFMSupport too. The final 2.1 and
1742.1.1 installers always copied the shared libraries on OSX, so it does
Jack Jansenc1218bc2001-04-25 22:11:24 +0000175not have the problem anymore.
176
Jack Jansen83cab721997-08-26 13:25:06 +0000177Things to see
178-------------
179
Jack Jansen12a37b72000-05-06 23:01:07 +0000180Start off at Mac:Demo:index.html. Read at least the first few sections.
181
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000182There are also some interesting files in the "Relnotes" folder that may
Jack Jansen83cab721997-08-26 13:25:06 +0000183contain useful information. There is also a first stab at documentation
184(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
Jack Jansen12a37b72000-05-06 23:01:07 +0000185machine-independent demos.
186The Mac:Lib:test folder also has some programs that show simple
Jack Jansen83cab721997-08-26 13:25:06 +0000187capabilities of various modules.
188
Jack Jansen1a29ed72001-10-31 10:13:52 +0000189The ":Mac:scripts" folder has some sample scripts. Some are useful,
190some are just interesting to look at to see how various things
191work. The MkDistr, mkapplet and fullbuild scripts (plus the ones
192mentioned above) may help you to understand how to use AppleEvents and
193various other toolboxes from python.
Jack Jansen83cab721997-08-26 13:25:06 +0000194
Jack Jansen1a29ed72001-10-31 10:13:52 +0000195Other mac-specific goodies can be found in :Mac:Tools, of which the
196IDE sources and a CGI framework deserve special mention.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000197
Jack Jansen83cab721997-08-26 13:25:06 +0000198The 'img' group of modules, which handles I/O of many different image
Jack Jansend0ddb661998-04-27 15:14:36 +0000199formats is included, but without documentation. You can find docs at
200ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
201
202Finally there is a Mac:Contrib folder which contains some contributed
Jack Jansen12a37b72000-05-06 23:01:07 +0000203software.
Jack Jansen83cab721997-08-26 13:25:06 +0000204
205Upgrading from older Python releases
206------------------------------------
207
Jack Jansen1a29ed72001-10-31 10:13:52 +0000208Python releases are independent of each other, with separate
209Preferences files, shared library names, etc. The good news is that
210this means you can keep your older version around if you are unsure
Jack Jansen83cab721997-08-26 13:25:06 +0000211whether to upgrade. The bad news is that your old preference settings
212are lost and you have to set them again.
213
Jack Jansenb3be2162001-11-30 14:16:36 +0000214After you are satisfied that 2.2b2 works as expected you can trash
Jack Jansen83cab721997-08-26 13:25:06 +0000215anything in the system folder that has "python" in the name and not
Jack Jansenb3be2162001-11-30 14:16:36 +0000216"2.2b2".
Jack Jansen83cab721997-08-26 13:25:06 +0000217
Jack Jansen1a29ed72001-10-31 10:13:52 +0000218The ConfigurePython... applets will try to detect incompatible
219preferences files and offer to remove them. This means that re-running
220ConfigurePython after a second install of the same MacPython version
221(or after moving the Python folder) should fix things up correctly.
Jack Jansen2b73fe92001-03-27 21:38:55 +0000222
Jack Jansen83cab721997-08-26 13:25:06 +0000223The installer
224-------------
225
Jack Jansen12a37b72000-05-06 23:01:07 +0000226The installer for this product was created using Installer VISE
227from MindVision Software. For more information on Installer VISE,
Jack Jansen83cab721997-08-26 13:25:06 +0000228contact:
229MindVision Software
2307201 North 7th Street
231Lincoln, NE 68521-8913
232Voice: 402-477-3269
233Fax: 402-477-1395
234Internet: mindvision@mindvision.com
235http://www.mindvision.com
236
Just van Rossumd16199a2001-12-13 12:58:09 +0000237Just van Rossum <just@letterror.com> created the initial version of the
Jack Jansen12a37b72000-05-06 23:01:07 +0000238installer (with Installer Vise Lite), and Jack worked from there.
Jack Jansen83cab721997-08-26 13:25:06 +0000239
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000240Thanks!
241-------
242
Jack Jansen965226b2000-09-14 20:58:24 +0000243Thanks go to the whole Python community with Guido in the lead, of
244course. Mac-specific thanks go to the pythonmac-sig, Just van Rossum,
245Corran Webster, Tony Ingraldi, Erik van Blokland, Bill Bedford, Chris
246Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David
Jack Jansen538bd132000-10-19 21:58:27 +0000247Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn,
Jack Jansenf7e57142001-09-08 21:38:26 +0000248Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer,
Jack Jansen1a29ed72001-10-31 10:13:52 +0000249Alexandre Parenteau, Donovan Preston
Jack Jansende1d4952001-08-27 15:30:48 +0000250and all the other people who provided feedback, code or both!
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000251
Jack Jansen1a29ed72001-10-31 10:13:52 +0000252MacPython includes waste, a TextEdit replacement which is (c) 1998
253Marco Piovanelli.
Jack Jansende519092000-10-12 21:21:43 +0000254
Jack Jansen1a29ed72001-10-31 10:13:52 +0000255A special mention is deserved by Matthias Neeracher, who has written
256the brilliant unix-compatible GUSI I/O library, without which
257MacPython would not have sockets or select, and to Alexandre
258Parenteau, who has ported this library to Carbon.
Jack Jansen9080e9b2001-01-23 21:03:52 +0000259
Jack Jansen83cab721997-08-26 13:25:06 +0000260Feedback
261--------
262
263Send bug reports, suggestions, contributions and fanmail to
Jack Jansenecbc1cc1998-01-06 12:13:16 +0000264<jack@cwi.nl>. However, a better way to discuss MacPython is to join the
Jack Jansen83cab721997-08-26 13:25:06 +0000265<pythonmac-sig@python.org> mailing list, which is explicitly meant for
266this purpose.
267
Jack Jansenb25ec912001-03-05 15:44:55 +0000268
Jack Jansen83cab721997-08-26 13:25:06 +0000269Jack Jansen
Jack Jansen12a37b72000-05-06 23:01:07 +0000270Oratrix Development BV
271Valeriusplein 30
272Amsterdam
Jack Jansen83cab721997-08-26 13:25:06 +0000273the Netherlands
274
275<jack@cwi.nl>, http://www.cwi.nl/~jack