★ wanayoo — archive 1999 http://www.netaxs.com/~mryan/python/install_win95.htmlNouvelle recherche | Portail wanayoo

Installing Python/Tkinter on Windows 95

Home | Python Pages | PC Python Survival Guide
What's New | Help and Information | Email Me


Note: Due to Fredrik Lundh's P14 package, these instructions and the involved process they require are no longer necessary. While I will no longer be maintaining these instructions, I will keep them for reference purposes.

These instructions are based on a set of instructions passed on to me from Kip Lehman by way of Manny Juan. Well, at least I think that that is the lineage of these instructions.

Following these instructions should result in successfully installing Python version 1.4 with the Tkinter library on your system. Sucess will be defined as being capable of doing the following:

  1. Starting up the Python interpreter by the following means:
    1. From the Explorer.
    2. From the Run item on the Start menu.
    3. From an MS-DOS window.
  2. Running the Python test suite.
  3. Executing the Tkinter _test() function.

Before starting the installation process, you might want to print out these instructions for ease of referral as you work through the installation process. You may also find it helpful to make notes as you go, especially on what directories you're using.

Getting Ready for the Installation

Setting Up Directories

Before downloading any files, you should organize your directories. You will need establish two directories. Please note, that your exact directories will vary. Feel free to vary the location of the directories. To make this easier, I'll refer to the directories by their all-caps names through out these instructions.

Symbol Explanation Recommended
PYTHON The directory containing all of your installed, Python-related files. C:\Program Files\Python14
STAGING The directory to download files to and to perform installations from. C:\Program Files\Installation

Under the PYTHON directory, create the subdirectories Lib and Bin.

Downloading the Files

After setting up your directories, you need to download the following archives into your STAGING directory:

You should also have some sort of unzipping utility, such as WinZip. Whichever unzip utility you use, it will need to allow for long filenames, retaining original pathnames, and for selectively unzipping files.

Installing the Components

Install the Python Core Files

From the Explorer, run STAGING\python-win-10-b5.exe. This will start the installation process for PythonWin. Provide your PYTHON (remember to type out its full pathname) as the installation directory. Next, select a custom installation, and install the Python Core and Win32 Extensions components.

Install the Tkinter Library Scripts

Open up STAGING\lib1_4_tar.gz with your unzip utility (or obtain a listing of its contents). Unzip the contents of Lib\tkinter of the archive into PYTHON\Lib\Tkinter.

Install the Imaging Library

Open up STAGING\Imaging-0_2b4-win32.zip with your unzip utility and unzip it, retaining its pathnames, directly into the PYTHON directory. This will create the directory PYTHON\Imaging-0.2b4. If you wish, you can rename the directory to something simpler, such as PIL or Imaging; this directory will be referred to as IMAGING.

Rearranging Some Files

This step is purely optional; however, later steps will assume that this step was carried out. Rearranging the files as described will help keep your Python files more self-contained and easier to maintain.

Setting Registry Entries and Environment Variables

Setting Registry Entries

Start up Regedit.exe from the Start item of the Start menu. Verify that the following registry keys have been set. Only those keys that need to be changed will be mentioned.

Setting Environment Variables and DOS Path

Edit your autoexec.bat using a text editor of your choice. Add the following commands, remembering to expand out all pathnames:

Note: I'm not entirely sure if this step is necessary. Also, if you have a regular version of Tcl/Tk installed, set the directories to the directories appropriate for their locations.

Add the following paths to your path statement:

Reboot and Test

Restart your computer to set the new variables and to fully update the registry. Assuming that we did everything right, you should now have a fully functional Python/Tkinter/Imaging suite.

To test out the installation, perform each of the checks. If there are any errors or problems, go back over what you did, and verify that you did it correctly. If there are still errors, either mail me or post the problem to comp.lang.python.

Starting the Python Interpreter

The first criterion for a sucessful installation is the ability to start the Python interpreter. Success should result in the interpreter starting up and being ready for input. Just type exit the interpreter by typing:

raise SystemExit

Executing the Python Test Suite

Open an MS-DOS window, and change directory into PYTHON\Lib\test. Execute the test all script:

python testall.py

All tests should pass.

Testing Tkinter

Start up the Python interpreter by any means you prefer. At the prompt, enter the statements:

import Tkinter
Tkinter._test()

A proof of existence window should be created.


Congratulations!

You now have a fully function copy of Python, complete with a platform-independent GUI toolkit and imaging library. Enjoy!


HTML 3.2
	  checked Michael W. Ryan (mryan@netaxs.com)
Last modified: Tue Oct 14 00:07:32 EDT 1997