blob: 29a3fe85f128bd83c59d076162092df95c969d54 [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 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 Jansen1a29ed72001-10-31 10:13:52 +0000131test_time will fail because MacPython accepts bogus values for
132mktime(), this will be fixed later (it is not a very serious problem).
Jack Jansenf7e57142001-09-08 21:38:26 +0000133
134test_descrtut will fail because of a problem with the test itself.
135
136Three tests will fail on MacOS9 with MemoryErrors:
Jack Jansen5d528b72001-10-23 22:22:09 +0000137test_longexp, test_sha and test_zlib (on MacOSX these should pass).
Jack Jansen2b73fe92001-03-27 21:38:55 +0000138
Jack Jansen1a29ed72001-10-31 10:13:52 +0000139If you increase the PythonInterpreter memory partition size they will
140pass (but for longexp you have to increase it by an incredible amount,
141400MB is rumoured). It will, however, print some messages about
142optional features not supported. You should not worry about these,
143they are modules that are supported by Python on other
144platforms. Also, if you didn't run compileall before autotesting you
145may run out of memory the first time you run the tests. test_socket
146may also fail if you have no internet connection. Please also read the
147Relnotes file for other minor problems with this distribution.
Jack Jansen83cab721997-08-26 13:25:06 +0000148
Jack Jansen1a29ed72001-10-31 10:13:52 +0000149Using Python is most easily done from the IDE, which has a builtin
150editor, debugger and other goodies. The alternative is to use
151PythonInterpreter, which is the lowlevel interpreter with a
152console-window only (similar to Unix Python).
Jack Jansen83cab721997-08-26 13:25:06 +0000153
Jack Jansen1a29ed72001-10-31 10:13:52 +0000154If your program uses Tkinter you MUST run it under PythonInterpreter,
155Tkinter and IDE are incompatible and your program will fail in strange
156ways.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000157
Jack Jansen0b726951997-10-08 15:34:42 +0000158Uninstalling
159------------
160
161Two items are installed in the system folder: the interpreter shared
Jack Jansen1a29ed72001-10-31 10:13:52 +0000162libraries PythonCore and PythonCoreCarbon lives in the Extensions
163folder and the "Python 2.2b1 Preferences" file in the Python subfolder
164in the Preferences folder. All the rest of Python lives in the folder
165you installed in.
Jack Jansen0b726951997-10-08 15:34:42 +0000166
Jack Jansen1a29ed72001-10-31 10:13:52 +0000167On OSX the libraries are installed in /Library/CFMSupport. There is a
168nasty bug in OSX that is triggered by Python: if any orphaned aliases
169are left in /Library/CFMSupport your machine will start to behave very
170badly. 2.1 beta installers triggered this problem if you simply threw
171away your Python folder, so if you installed a 2.1beta you should
172clean out the aliases in /Library/CFMSupport too. The final 2.1 and
1732.1.1 installers always copied the shared libraries on OSX, so it does
Jack Jansenc1218bc2001-04-25 22:11:24 +0000174not have the problem anymore.
175
Jack Jansen83cab721997-08-26 13:25:06 +0000176Things to see
177-------------
178
Jack Jansen12a37b72000-05-06 23:01:07 +0000179Start off at Mac:Demo:index.html. Read at least the first few sections.
180
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000181There are also some interesting files in the "Relnotes" folder that may
Jack Jansen83cab721997-08-26 13:25:06 +0000182contain useful information. There is also a first stab at documentation
183(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
Jack Jansen12a37b72000-05-06 23:01:07 +0000184machine-independent demos.
185The Mac:Lib:test folder also has some programs that show simple
Jack Jansen83cab721997-08-26 13:25:06 +0000186capabilities of various modules.
187
Jack Jansen1a29ed72001-10-31 10:13:52 +0000188The ":Mac:scripts" folder has some sample scripts. Some are useful,
189some are just interesting to look at to see how various things
190work. The MkDistr, mkapplet and fullbuild scripts (plus the ones
191mentioned above) may help you to understand how to use AppleEvents and
192various other toolboxes from python.
Jack Jansen83cab721997-08-26 13:25:06 +0000193
Jack Jansen1a29ed72001-10-31 10:13:52 +0000194Other mac-specific goodies can be found in :Mac:Tools, of which the
195IDE sources and a CGI framework deserve special mention.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000196
Jack Jansen83cab721997-08-26 13:25:06 +0000197The 'img' group of modules, which handles I/O of many different image
Jack Jansend0ddb661998-04-27 15:14:36 +0000198formats is included, but without documentation. You can find docs at
199ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
200
201Finally there is a Mac:Contrib folder which contains some contributed
Jack Jansen12a37b72000-05-06 23:01:07 +0000202software.
Jack Jansen83cab721997-08-26 13:25:06 +0000203
204Upgrading from older Python releases
205------------------------------------
206
Jack Jansen1a29ed72001-10-31 10:13:52 +0000207Python releases are independent of each other, with separate
208Preferences files, shared library names, etc. The good news is that
209this means you can keep your older version around if you are unsure
Jack Jansen83cab721997-08-26 13:25:06 +0000210whether to upgrade. The bad news is that your old preference settings
211are lost and you have to set them again.
212
Jack Jansen5d528b72001-10-23 22:22:09 +0000213After you are satisfied that 2.2b1 works as expected you can trash
Jack Jansen83cab721997-08-26 13:25:06 +0000214anything in the system folder that has "python" in the name and not
Jack Jansen5d528b72001-10-23 22:22:09 +0000215"2.2b1".
Jack Jansen83cab721997-08-26 13:25:06 +0000216
Jack Jansen1a29ed72001-10-31 10:13:52 +0000217The ConfigurePython... applets will try to detect incompatible
218preferences files and offer to remove them. This means that re-running
219ConfigurePython after a second install of the same MacPython version
220(or after moving the Python folder) should fix things up correctly.
Jack Jansen2b73fe92001-03-27 21:38:55 +0000221
Jack Jansen83cab721997-08-26 13:25:06 +0000222The installer
223-------------
224
Jack Jansen12a37b72000-05-06 23:01:07 +0000225The installer for this product was created using Installer VISE
226from MindVision Software. For more information on Installer VISE,
Jack Jansen83cab721997-08-26 13:25:06 +0000227contact:
228MindVision Software
2297201 North 7th Street
230Lincoln, NE 68521-8913
231Voice: 402-477-3269
232Fax: 402-477-1395
233Internet: mindvision@mindvision.com
234http://www.mindvision.com
235
Jack Jansen12a37b72000-05-06 23:01:07 +0000236Just van Rossum <just@letterror.nl> created the initial version of the
237installer (with Installer Vise Lite), and Jack worked from there.
Jack Jansen83cab721997-08-26 13:25:06 +0000238
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000239Thanks!
240-------
241
Jack Jansen965226b2000-09-14 20:58:24 +0000242Thanks go to the whole Python community with Guido in the lead, of
243course. Mac-specific thanks go to the pythonmac-sig, Just van Rossum,
244Corran Webster, Tony Ingraldi, Erik van Blokland, Bill Bedford, Chris
245Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David
Jack Jansen538bd132000-10-19 21:58:27 +0000246Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn,
Jack Jansenf7e57142001-09-08 21:38:26 +0000247Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer,
Jack Jansen1a29ed72001-10-31 10:13:52 +0000248Alexandre Parenteau, Donovan Preston
Jack Jansende1d4952001-08-27 15:30:48 +0000249and all the other people who provided feedback, code or both!
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000250
Jack Jansen1a29ed72001-10-31 10:13:52 +0000251MacPython includes waste, a TextEdit replacement which is (c) 1998
252Marco Piovanelli.
Jack Jansende519092000-10-12 21:21:43 +0000253
Jack Jansen1a29ed72001-10-31 10:13:52 +0000254A special mention is deserved by Matthias Neeracher, who has written
255the brilliant unix-compatible GUSI I/O library, without which
256MacPython would not have sockets or select, and to Alexandre
257Parenteau, who has ported this library to Carbon.
Jack Jansen9080e9b2001-01-23 21:03:52 +0000258
Jack Jansen83cab721997-08-26 13:25:06 +0000259Feedback
260--------
261
262Send bug reports, suggestions, contributions and fanmail to
Jack Jansenecbc1cc1998-01-06 12:13:16 +0000263<jack@cwi.nl>. However, a better way to discuss MacPython is to join the
Jack Jansen83cab721997-08-26 13:25:06 +0000264<pythonmac-sig@python.org> mailing list, which is explicitly meant for
265this purpose.
266
Jack Jansenb25ec912001-03-05 15:44:55 +0000267
Jack Jansen83cab721997-08-26 13:25:06 +0000268Jack Jansen
Jack Jansen12a37b72000-05-06 23:01:07 +0000269Oratrix Development BV
270Valeriusplein 30
271Amsterdam
Jack Jansen83cab721997-08-26 13:25:06 +0000272the Netherlands
273
274<jack@cwi.nl>, http://www.cwi.nl/~jack