| ★ wanayoo — archive 1999 http://www.netaxs.com/~mryan/python/install_win95.html | Nouvelle recherche | Portail wanayoo |
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:
_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.
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.
After setting up your directories, you need to
download the following archives into your
STAGING directory:
Tkinter.py and other Tkinter scripts.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.
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.
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.
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.
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.
python.exe and bsddb.pyd from
PYTHON to
PYTHON\Bin.python.dll from
C:\Windows\System (or wherever you Windows sytem
files are) to
PYTHON\Bin. Note: could
someone confirm if this is a good or bad thing?_tkinter.dll from
IMAGING to
PYTHON\Lib\Tkinter.C:\Windows\System with tcl76.dll,
tclpip76.dll, and tk42.dll from
IMAGING. These versions were compiled
with MSVC and won't yield an annoying invalid page fault when
exiting. If you don't have a regular Tcl/Tk installation, you
will want to move the DLLs to
PYTHON\Bin.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.
\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\1.4.0\Dll
, the Default key has a value equal to the
full pathname of the Python DLL,
PYTHON\Bin\Python14.dll (remember to
write out the pathname).
\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\1.4.0\PythonPath
, the Default key has a value indicating
all of directories to be searched for Python libraries. The
directories are listed in order of precedence and are joined
by semi-colons (;), just like the DOS path. They should
include, in order:
python.dll and
bsddb.pyd
(PYTHON\Bin).PYTHON\Lib\Win).PYTHON\Lib).<;li>
_tkinter.dll and the
Tkinter library scripts
(PYTHON\Lib\tkinter).IMAGING\Lib).
\HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\1.4.0\PythonPath\tkinter
, the Default key should have a value
equal to where you put _tkinter.dll
(PYTHON\Lib\tkinter).Edit your autoexec.bat using a text
editor of your choice. Add the following commands, remembering
to expand out all pathnames:
SET
TCL_LIBRARY=IMAGING\tcl7.6\librarySET
TK_LIBRARY=IMAGING\tk4.2\libraryNote: 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:
python.exe and
python.dll
(PYTHON\Bin)._tkinter.dll
(PYTHON\Lib\tkinter)._imaging.dll
(IMAGING).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.
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
PYTHON\Bin and double-click
python.exe.python.exe.Open an MS-DOS window, and change directory into
PYTHON\Lib\test. Execute the test all
script:
python testall.py
All tests should pass.
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.
You now have a fully function copy of Python, complete with a platform-independent GUI toolkit and imaging library. Enjoy!