blob: 974509068fb9a244c833bed8a22b2f2ae1fe5adb [file] [log] [blame]
Jack Jansen6bc62c42001-12-20 20:41:45 +00001How to install Python 2.2c1 on your Macintosh
Jack Jansencbed91b2001-08-03 13:31:36 +00002---------------------------------------------
Jack Jansen2f9a9e32001-02-17 22:03:42 +00003
Jack Jansen6bc62c42001-12-20 20:41:45 +00004This is a release candidate for MacPython 2.2, please report any problems as
5soon as possible, by email to pythonmac-sig@python.org.
6
Jack Jansenc1218bc2001-04-25 22:11:24 +00007This is a MacPython that can run on classic MacOS (from 8.1
Jack Jansencbe7b1c2001-03-06 22:42:12 +00008onwards) and natively on MacOSX. The installer tries to work out whether you can
Jack Jansen6bc62c42001-12-20 20:41:45 +00009use the Carbon version or not. For Mac OS X users: this version of Python
10does not run from the command line, it is a pure "Mac only" app. Use the standard
11unix Python from the commandline, the two Pythons will be merged in the future.
Jack Jansen2f9a9e32001-02-17 22:03:42 +000012
Jack Jansen028f2d52001-08-29 22:04:08 +000013You should definitely read the Relnotes file too, and the section below about
Jack Jansen5d528b72001-10-23 22:22:09 +000014toolbox module reorganization. You should also read :Misc:NEWS, which lists
15the general (non-mac-dependent) new features of this Python release.
Jack Jansen2f9a9e32001-02-17 22:03:42 +000016
Jack Jansenc1218bc2001-04-25 22:11:24 +000017A special note about the active installer: do not background it, it may hang
Jack Jansen2b73fe92001-03-27 21:38:55 +000018your machine. This is a general problem with Vise active installers, MindVision
19are working on it.
Jack Jansen8ef786e2001-03-15 14:27:09 +000020
Jack Jansen2f9a9e32001-02-17 22:03:42 +000021------
Jack Jansen83cab721997-08-26 13:25:06 +000022
23If this is your first encounter with Python: you definitely need the
24common user documentation (common to all platforms). You can find this
Jack Jansen538bd132000-10-19 21:58:27 +000025(in various forms) on www.pythonlabs.com, www.python.org and
26ftp.python.org. Through there, or via
27http://www.cwi.nl/~jack/macpython.html you can also find the most recent
28MacPython distribution.
Jack Jansen83cab721997-08-26 13:25:06 +000029
30Mac-specific documentation is included in this distribution in folder
31Mac:Demo. The documentation is sparse, but it will have to serve for
32now. The documentation is in HTML format, start with index.html.
33
Jack Jansencbe7b1c2001-03-06 22:42:12 +000034This installer installs MacPython for classic PPC MacOS, MacPython for Carbon
35(OS X, OS 9 or OS8 with CarbonLib installed) or both, depending on your
36configuration. By selecting custom install you can bypass these tests and
37install what you want.
Jack Jansenecbc1cc1998-01-06 12:13:16 +000038
Jack Jansen2b73fe92001-03-27 21:38:55 +000039If you want 68k support you will have to stay with MacPython 1.5.2.
Jack Jansen965226b2000-09-14 20:58:24 +000040
Jack Jansen028f2d52001-08-29 22:04:08 +000041Toolbox module reorganization and more
42--------------------------------------
43
44You can safely skip this section if this is your first encounter with MacPython.
45
46I am working on a new organization of the mac-specific modules, and in
47general bringing the MacPython folder structure more in line with
48unix-Python. This is not only a good idea, it will also immensely
49facilitate moving MacPython functionality to an OSX Python that is based
50on Mach-O and the unix-Python distribution. But don't worry: MacPython
51is definitely not dead yet, and the hope is that the transition will be
52as seamless as possible.
53
54First a change that should not cause too much concern: :Mac:Plugins has
55gone, and most of the dynamically loaded modules have moved to
56:Lib:lib-dynload.
57
58Second, and more important: the toolbox modules, such as Res and
59Resource, have moved to a Carbon package. So, in stead of "import Res"
60you should now say "from Carbon import Res" and in stead of "from Res
61import *" you should use "from Carbon.Res import *". For the lifetime of
62MacPython 2.2 there is a folder :Mac:Lib:lib-compat on sys.path that
63contains modules with the old names which imports the new names after
64issuing a warning.
65
66Note that although the package is called Carbon the modules work fine under
67classic PPC, and they are normal classic modules. Also note that some
68modules you may think of as toolbox modules (such as Waste) really are not,
69and they are not in the Carbon package.
Jack Jansen6bc62c42001-12-20 20:41:45 +000070
71Also, all toolbox modules have been updated to Universal Headers 3.4, and
72are (for classic PPC) weak-linked against InterfaceLib so that they should
73work on all systems back to MacOS 8.1. Calling an unimplemented function will
74raise an exception, not crash your interpreter.
Jack Jansen028f2d52001-08-29 22:04:08 +000075
76Another change related to the OSX growth path is that there is a new module
77macresource that you can use to easily open a resource file accompanying your
78script. Use "macresource.need("DLOG", MY_DIALOG_ID, "name.rsrc") and if the
79given resource is not available (it _is_ available if your script has been
80turned into an applet) the given resource file will be opened. This method will
81eventually also contain the magic needed to open the resource file on
82OSX MachO Python.
83
Jack Jansen1a29ed72001-10-31 10:13:52 +000084Another feature to help with the OSX transition is that if you open a
85textfile for reading MacPython will now accept either unix linefeeds
86(LF, '\n') or Macintosh linefeeds (CR, '\r') and present both of them
87as '\n'. This is done on a low level, so it works for files opened by
88scripts as well as for your scripts and modules itself. This can be
89turned off with a preference/startup option.
Jack Jansen028f2d52001-08-29 22:04:08 +000090
91But:
92- this works only for input, and there's no way to find out what the original
93 linefeed convention of the file was.
Jack Jansen028f2d52001-08-29 22:04:08 +000094- Windows \r\n linefeeds are not supported and get turned into \n\n.
95
Jack Jansen83cab721997-08-26 13:25:06 +000096What to install
97---------------
98
Jack Jansen12a37b72000-05-06 23:01:07 +000099The optional parts in this distribution are
Jack Jansen1a29ed72001-10-31 10:13:52 +0000100- TK+PIL: Tkinter and support modules, plus Imaging, the Python image
101 manipulation package (allows you to read, write and display images and
102 do lots of operations on them).
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000103 For Carbon MacPython you only get PIL: there is no Tcl/Tk for Carbon yet.
Jack Jansen1a29ed72001-10-31 10:13:52 +0000104 This is the reason Classic MacPython is also installed on MacOSX: it
105 allows you to run Tkinter applications, albeit in the Classic box.
Jack Jansen12a37b72000-05-06 23:01:07 +0000106- img: another imaging package. Has more file format support and is faster
107 than imaging, but has only limited operations on images. There is a bridge
108 between the packages.
109- Numeric: the LLNL Numeric Python extension. All sorts of nifty operations
Jack Jansen1a29ed72001-10-31 10:13:52 +0000110 on matrices and such. This is the most recent version from the
111 sourceforge archive.
112 Numeric has moved from Extensions to :Lib:site-python, by the way,
113 see the release notes.
114- Developers kit: all header files and some tools and sample projects
115 to get you started on writing Python extensions if you have CodeWarrior.
Jack Jansen12a37b72000-05-06 23:01:07 +0000116All these except the DevKit are installed with Easy Install.
Jack Jansen83cab721997-08-26 13:25:06 +0000117
Jack Jansencbe7b1c2001-03-06 22:42:12 +0000118After the installer finishes it automatically launches the appropriate
Jack Jansen1a29ed72001-10-31 10:13:52 +0000119ConfigurePython applet, to finish configuration of your Python. If you
120run MacOS9 or later (or 8 with CarbonLib installed) you can switch
121back and forth between the classic and Carbon versions of Python by
122running either ConfigurePythonClassic or ConfigurePythonCarbon.
Jack Jansen83cab721997-08-26 13:25:06 +0000123
Jack Jansen1a29ed72001-10-31 10:13:52 +0000124Moving your Python installation after installing is generally not a
125good idea. If you have to do this anyway you should remove your
126preference file, run ConfigurePython and remove all .pyc
127files. (there's a script zappyc.py that does the latter).
Jack Jansen2e42bdd2000-11-14 20:37:37 +0000128
Jack Jansen83cab721997-08-26 13:25:06 +0000129If you don't have enough memory: the sizes choosen are somewhat
Jack Jansen1a29ed72001-10-31 10:13:52 +0000130arbitrary, and they are as high as they are so that test.autotest runs
131with fewer problems. An average Python program can make do with much
132less memory. Try lowering the application sizes in the finder "get
133info" window, and seeing whether the resulting python is still usable.
Jack Jansen83cab721997-08-26 13:25:06 +0000134
Jack Jansen83cab721997-08-26 13:25:06 +0000135After installing
136----------------
137
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000138It is probably a good idea to run the automatic tests. Start
Jack Jansenf7e57142001-09-08 21:38:26 +0000139Python and "import test.regrtest ; test.regrtest.main()".
Jack Jansende519092000-10-12 21:21:43 +0000140
Jack Jansenb3be2162001-11-30 14:16:36 +0000141test_frozen will fail in MacPython because of different handling on
142frozen modules. This should not be a problem in normal use.
143
Jack Jansen1a29ed72001-10-31 10:13:52 +0000144test_time will fail because MacPython accepts bogus values for
145mktime(), this will be fixed later (it is not a very serious problem).
Jack Jansenf7e57142001-09-08 21:38:26 +0000146
Jack Jansenf7e57142001-09-08 21:38:26 +0000147Three tests will fail on MacOS9 with MemoryErrors:
Jack Jansen5d528b72001-10-23 22:22:09 +0000148test_longexp, test_sha and test_zlib (on MacOSX these should pass).
Jack Jansen2b73fe92001-03-27 21:38:55 +0000149
Jack Jansen1a29ed72001-10-31 10:13:52 +0000150If you increase the PythonInterpreter memory partition size they will
151pass (but for longexp you have to increase it by an incredible amount,
152400MB is rumoured). It will, however, print some messages about
153optional features not supported. You should not worry about these,
154they are modules that are supported by Python on other
155platforms. Also, if you didn't run compileall before autotesting you
156may run out of memory the first time you run the tests. test_socket
157may also fail if you have no internet connection. Please also read the
158Relnotes file for other minor problems with this distribution.
Jack Jansen83cab721997-08-26 13:25:06 +0000159
Jack Jansen1a29ed72001-10-31 10:13:52 +0000160Using Python is most easily done from the IDE, which has a builtin
161editor, debugger and other goodies. The alternative is to use
162PythonInterpreter, which is the lowlevel interpreter with a
163console-window only (similar to Unix Python).
Jack Jansen83cab721997-08-26 13:25:06 +0000164
Jack Jansen1a29ed72001-10-31 10:13:52 +0000165If your program uses Tkinter you MUST run it under PythonInterpreter,
166Tkinter and IDE are incompatible and your program will fail in strange
167ways.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000168
Jack Jansen0b726951997-10-08 15:34:42 +0000169Uninstalling
170------------
171
172Two items are installed in the system folder: the interpreter shared
Jack Jansen1a29ed72001-10-31 10:13:52 +0000173libraries PythonCore and PythonCoreCarbon lives in the Extensions
Jack Jansen6bc62c42001-12-20 20:41:45 +0000174folder and the "Python 2.2c1 Preferences" file in the Python subfolder
Jack Jansen1a29ed72001-10-31 10:13:52 +0000175in the Preferences folder. All the rest of Python lives in the folder
176you installed in.
Jack Jansen0b726951997-10-08 15:34:42 +0000177
Jack Jansen1a29ed72001-10-31 10:13:52 +0000178On OSX the libraries are installed in /Library/CFMSupport. There is a
179nasty bug in OSX that is triggered by Python: if any orphaned aliases
180are left in /Library/CFMSupport your machine will start to behave very
181badly. 2.1 beta installers triggered this problem if you simply threw
182away your Python folder, so if you installed a 2.1beta you should
183clean out the aliases in /Library/CFMSupport too. The final 2.1 and
1842.1.1 installers always copied the shared libraries on OSX, so it does
Jack Jansenc1218bc2001-04-25 22:11:24 +0000185not have the problem anymore.
186
Jack Jansen83cab721997-08-26 13:25:06 +0000187Things to see
188-------------
189
Jack Jansen12a37b72000-05-06 23:01:07 +0000190Start off at Mac:Demo:index.html. Read at least the first few sections.
191
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000192There are also some interesting files in the "Relnotes" folder that may
Jack Jansen83cab721997-08-26 13:25:06 +0000193contain useful information. There is also a first stab at documentation
194(plus examples) in the Mac:Demo folder. The toplevel Demo folder has
Jack Jansen12a37b72000-05-06 23:01:07 +0000195machine-independent demos.
196The Mac:Lib:test folder also has some programs that show simple
Jack Jansen83cab721997-08-26 13:25:06 +0000197capabilities of various modules.
198
Jack Jansen1a29ed72001-10-31 10:13:52 +0000199The ":Mac:scripts" folder has some sample scripts. Some are useful,
200some are just interesting to look at to see how various things
201work. The MkDistr, mkapplet and fullbuild scripts (plus the ones
202mentioned above) may help you to understand how to use AppleEvents and
203various other toolboxes from python.
Jack Jansen83cab721997-08-26 13:25:06 +0000204
Jack Jansen1a29ed72001-10-31 10:13:52 +0000205Other mac-specific goodies can be found in :Mac:Tools, of which the
206IDE sources and a CGI framework deserve special mention.
Jack Jansen8a6cdcc2000-09-10 12:02:28 +0000207
Jack Jansen83cab721997-08-26 13:25:06 +0000208The 'img' group of modules, which handles I/O of many different image
Jack Jansend0ddb661998-04-27 15:14:36 +0000209formats is included, but without documentation. You can find docs at
210ftp://ftp.cwi.nl/pub/jack/python/img (or somewhere around there).
211
212Finally there is a Mac:Contrib folder which contains some contributed
Jack Jansen12a37b72000-05-06 23:01:07 +0000213software.
Jack Jansen83cab721997-08-26 13:25:06 +0000214
215Upgrading from older Python releases
216------------------------------------
217
Jack Jansen1a29ed72001-10-31 10:13:52 +0000218Python releases are independent of each other, with separate
219Preferences files, shared library names, etc. The good news is that
220this means you can keep your older version around if you are unsure
Jack Jansen83cab721997-08-26 13:25:06 +0000221whether to upgrade. The bad news is that your old preference settings
222are lost and you have to set them again.
223
Jack Jansen6bc62c42001-12-20 20:41:45 +0000224After you are satisfied that 2.2c1 works as expected you can trash
Jack Jansen83cab721997-08-26 13:25:06 +0000225anything in the system folder that has "python" in the name and not
Jack Jansen6bc62c42001-12-20 20:41:45 +0000226"2.2c1".
Jack Jansen83cab721997-08-26 13:25:06 +0000227
Jack Jansen1a29ed72001-10-31 10:13:52 +0000228The ConfigurePython... applets will try to detect incompatible
229preferences files and offer to remove them. This means that re-running
230ConfigurePython after a second install of the same MacPython version
231(or after moving the Python folder) should fix things up correctly.
Jack Jansen2b73fe92001-03-27 21:38:55 +0000232
Jack Jansen83cab721997-08-26 13:25:06 +0000233The installer
234-------------
235
Jack Jansen12a37b72000-05-06 23:01:07 +0000236The installer for this product was created using Installer VISE
237from MindVision Software. For more information on Installer VISE,
Jack Jansen83cab721997-08-26 13:25:06 +0000238contact:
239MindVision Software
2407201 North 7th Street
241Lincoln, NE 68521-8913
242Voice: 402-477-3269
243Fax: 402-477-1395
244Internet: mindvision@mindvision.com
245http://www.mindvision.com
246
Just van Rossumd16199a2001-12-13 12:58:09 +0000247Just van Rossum <just@letterror.com> created the initial version of the
Jack Jansen12a37b72000-05-06 23:01:07 +0000248installer (with Installer Vise Lite), and Jack worked from there.
Jack Jansen83cab721997-08-26 13:25:06 +0000249
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000250Thanks!
251-------
252
Jack Jansen965226b2000-09-14 20:58:24 +0000253Thanks go to the whole Python community with Guido in the lead, of
254course. Mac-specific thanks go to the pythonmac-sig, Just van Rossum,
255Corran Webster, Tony Ingraldi, Erik van Blokland, Bill Bedford, Chris
256Stern, Gordon Worley, Oliver Steele, M. Papillon, Steven Majewski, David
Jack Jansen538bd132000-10-19 21:58:27 +0000257Goodger, Chris Barker, Luc Lefebvre, Tattoo Mabonzo K., Russell Finn,
Jack Jansenf7e57142001-09-08 21:38:26 +0000258Tom Bridgman, Russel Owen, Pascal Oberndoerfer, Dean Draayer,
Jack Jansen6bc62c42001-12-20 20:41:45 +0000259Alexandre Parenteau, Donovan Preston, Daniel Brotsky, Jason Harper,
260Nitin Ganatra,
Jack Jansende1d4952001-08-27 15:30:48 +0000261and all the other people who provided feedback, code or both!
Jack Jansen01ae9eb2000-04-22 22:57:25 +0000262
Jack Jansen1a29ed72001-10-31 10:13:52 +0000263MacPython includes waste, a TextEdit replacement which is (c) 1998
264Marco Piovanelli.
Jack Jansende519092000-10-12 21:21:43 +0000265
Jack Jansen1a29ed72001-10-31 10:13:52 +0000266A special mention is deserved by Matthias Neeracher, who has written
267the brilliant unix-compatible GUSI I/O library, without which
268MacPython would not have sockets or select, and to Alexandre
269Parenteau, who has ported this library to Carbon.
Jack Jansen9080e9b2001-01-23 21:03:52 +0000270
Jack Jansen83cab721997-08-26 13:25:06 +0000271Feedback
272--------
273
274Send bug reports, suggestions, contributions and fanmail to
Jack Jansenecbc1cc1998-01-06 12:13:16 +0000275<jack@cwi.nl>. However, a better way to discuss MacPython is to join the
Jack Jansen83cab721997-08-26 13:25:06 +0000276<pythonmac-sig@python.org> mailing list, which is explicitly meant for
277this purpose.
278
Jack Jansenb25ec912001-03-05 15:44:55 +0000279
Jack Jansen83cab721997-08-26 13:25:06 +0000280Jack Jansen
Jack Jansen12a37b72000-05-06 23:01:07 +0000281Oratrix Development BV
282Valeriusplein 30
283Amsterdam
Jack Jansen83cab721997-08-26 13:25:06 +0000284the Netherlands
285
286<jack@cwi.nl>, http://www.cwi.nl/~jack