Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59b0b60

Browse files
committed
Updates related to Modules/Setup and setup.py. This addresses SF bug
#512871 (Jon Ribbens): Installation instructions are wrong. Bugfix candidate.
1 parent 4a02f95 commit 59b0b60

1 file changed

Lines changed: 50 additions & 59 deletions

File tree

README

Lines changed: 50 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ current directory and when it finishes, type "make". This creates an
4545
executable "./python"; to install in /usr/local, first do "su root"
4646
and then "make install".
4747

48-
The section `Build Instructions' below is still recommended reading,
48+
The section `Build instructions' below is still recommended reading,
4949
especially the part on customizing Modules/Setup.
5050

5151

@@ -151,32 +151,36 @@ efficient way to ask public questions.
151151
Build instructions
152152
==================
153153

154-
Before you can build Python, you must first configure it. Fortunately,
155-
the configuration and build process has been streamlined for most Unix
156-
installations, so all you have to do is type a few commands,
157-
optionally edit one file, and sit back. There are some platforms
158-
where things are not quite as smooth; see the platform specific notes
159-
below. If you want to build for multiple platforms sharing the same
160-
source tree, see the section on VPATH below.
161-
162-
Start by running the script "./configure", which determines your system
163-
configuration and creates the Makefile. (It takes a minute or two --
164-
please be patient!) You may want to pass options to the configure
165-
script or edit the Modules/Setup file after running configure -- see the
166-
section below on configuration options and variables. When it's done,
167-
you are ready to run make.
168-
169-
To build Python, you normally type "make" in the toplevel directory. If
170-
you have changed the configuration or have modified Modules/Setup, the
171-
Makefile may have to be rebuilt. In this case you may have to run make
172-
again to correctly build your desired target. The interpreter
173-
executable is built in the top level directory.
154+
Before you can build Python, you must first configure it.
155+
Fortunately, the configuration and build process has been automated
156+
for Unix and Linux installations, so all you usually have to do is
157+
type a few commands and sit back. There are some platforms where
158+
things are not quite as smooth; see the platform specific notes below.
159+
If you want to build for multiple platforms sharing the same source
160+
tree, see the section on VPATH below.
161+
162+
Start by running the script "./configure", which determines your
163+
system configuration and creates the Makefile. (It takes a minute or
164+
two -- please be patient!) You may want to pass options to the
165+
configure script -- see the section below on configuration options and
166+
variables. When it's done, you are ready to run make.
167+
168+
To build Python, you normally type "make" in the toplevel directory.
169+
If you have changed the configuration, the Makefile may have to be
170+
rebuilt. In this case you may have to run make again to correctly
171+
build your desired target. The interpreter executable is built in the
172+
top level directory.
174173

175174
Once you have built a Python interpreter, see the subsections below on
176-
testing, configuring additional modules, and installation. If you run
177-
into trouble, see the next section. Editing the Modules/Setup file
178-
after running make is supported; just run "make" again after making
179-
the desired changes.
175+
testing and installation. If you run into trouble, see the next
176+
section.
177+
178+
Previous versions of Python used a manual configuration process that
179+
involved editing the file Modules/Setup. While this file still exists
180+
and manual configuration is still supported, it is rarely needed any
181+
more: almost all modules are automatically built as appropriate under
182+
guidance of the setup.py script, which is run by Make after the
183+
interpreter has been built.
180184

181185

182186
Troubleshooting
@@ -228,6 +232,7 @@ submit a documentation bug report to SourceForge (see Bug Reports
228232
above) so we can remove them!)
229233

230234
64-bit platforms: The modules audioop, imageop and rgbimg don't work.
235+
The setup.py script disables them on 64-bit installations.
231236
Don't try to enable them in the Modules/Setup file. They
232237
contain code that is quite wordsize sensitive. (If you have a
233238
fix, let us know!)
@@ -244,9 +249,8 @@ Linux: A problem with threads and fork() was tracked down to a bug in
244249
problem and solution reported by Pablo Bleyer.
245250

246251
Under Linux systems using GNU libc 2 (aka libc6), the crypt
247-
module now needs the -lcrypt option. Uncomment this flag in
248-
Modules/Setup, or comment out the crypt module in the same
249-
file. Most modern Linux systems use glibc2.
252+
module now needs the -lcrypt option. The setup.py script
253+
takes care of this automatically.
250254

251255
Red Hat Linux: There's an executable /usr/bin/python which is Python
252256
1.5.2 on most Red Hat installations; several key Red Hat tools
@@ -560,7 +564,12 @@ Configuring additional built-in modules
560564
Starting with Python 2.1, the setup.py script at the top of the source
561565
distribution attempts to detect which modules can be built and
562566
automatically compiles them. Autodetection doesn't always work, so
563-
you can customize the configuration by editing the Modules/Setup file.
567+
you can still customize the configuration by editing the Modules/Setup
568+
file; but this should be considered a last resort. The rest of this
569+
section only applies if you decide to edit the Modules/Setup file.
570+
You also need this to enable static linking of certain modules (which
571+
is needed to enable profiling on some systems).
572+
564573
This file is initially copied from Setup.dist by the configure script;
565574
if it does not exist yet, create it by copying Modules/Setup.dist
566575
yourself (configure will never overwrite it). Never edit Setup.dist
@@ -628,8 +637,7 @@ To test the interpreter, type "make test" in the top-level directory.
628637
This runs the test set twice (once with no compiled files, once with
629638
the compiled files left by the previous test run). The test set
630639
produces some output. You can generally ignore the messages about
631-
skipped tests due to optional features which can't be imported. (If
632-
you want to test those modules, edit Modules/Setup to configure them.)
640+
skipped tests due to optional features which can't be imported.
633641
If a message is printed about a failed test or a traceback or core
634642
dump is produced, something is wrong. On some Linux systems (those
635643
that are not yet using glibc 6), test_strftime fails due to a
@@ -732,8 +740,8 @@ Modules/getpath.o.
732740
than re-running the configure script if you change your mind
733741
about the install prefix.
734742

735-
--with-readline: This option is no longer supported. To use GNU
736-
readline, enable module "readline" in the Modules/Setup file.
743+
--with-readline: This option is no longer supported. GNU
744+
readline is automatically enabled by setup.py when present.
737745

738746
--with-threads: On most Unix systems, you can now use multiple
739747
threads, and support for this is enabled by default. To
@@ -888,26 +896,13 @@ files. (Newer versions of Emacs or XEmacs may already come with the
888896
latest version of python-mode.)
889897

890898

891-
The Tk interface
892-
----------------
899+
Tkinter
900+
-------
893901

894-
Tk (the user interface component of John Ousterhout's Tcl language) is
895-
also usable from Python. Since this requires that you first build and
896-
install Tcl/Tk, the Tk interface is not enabled by default when
897-
building Python from source. Python supports Tcl/Tk version 8.0 and
902+
The setup.py script automatically configures this when it detects a
903+
usable Tcl/Tk installation. This requires Tcl/Tk version 8.0 or
898904
higher.
899905

900-
See http://dev.ajubasolutions.com/ for more info on Tcl/Tk, including
901-
the on-line manual pages.
902-
903-
904-
To enable the Python/Tk interface, once you've built and installed
905-
Tcl/Tk, load the file Modules/Setup into your favorite text editor and
906-
search for the string "_tkinter". Then follow the instructions found
907-
there. If you have installed Tcl/Tk or X11 in unusual places, you
908-
will have to edit the first line to fix or add the -I and -L options.
909-
(Also see the general instructions at the top of that file.)
910-
911906
For more Tkinter information, see the Tkinter Resource page:
912907
http://www.python.org/topics/tkinter/
913908

@@ -919,15 +914,11 @@ Note that there's a Python module called "Tkinter" (capital T) which
919914
lives in Lib/lib-tk/Tkinter.py, and a C module called "_tkinter"
920915
(lower case t and leading underscore) which lives in
921916
Modules/_tkinter.c. Demos and normal Tk applications import only the
922-
Python Tkinter module -- the latter uses the C _tkinter module
923-
directly. In order to find the C _tkinter module, it must be compiled
924-
and linked into the Python interpreter -- the _tkinter line in the
925-
Setup file does this. In order to find the Python Tkinter module,
926-
sys.path must be set correctly -- the TKPATH assignment in the Setup
927-
file takes care of this, but only if you install Python properly
928-
("make install libinstall"). (You can also use dynamic loading for
929-
the C _tkinter module, in which case you must manually fix up sys.path
930-
or set $PYTHONPATH for the Python Tkinter module.)
917+
Python Tkinter module -- only the latter imports the C _tkinter
918+
module. In order to find the C _tkinter module, it must be compiled
919+
and linked into the Python interpreter -- the setup.py script does
920+
this. In order to find the Python Tkinter module, sys.path must be
921+
set correctly -- normal installation takes care of this.
931922

932923

933924
Distribution structure

0 commit comments

Comments
 (0)