%general-entities; ]> $LastChangedBy$ $Date$ Python-&python2-version; Python2 Introduction to Python 2 The Python 2 package contains the Python development environment. It is useful for object-oriented programming, writing scripts, prototyping large programs or developing entire applications. This version is for backward compatibility with other dependent packages. Python2 has been deprecated by the upstream developers. Support for Python2 was discontinued on January 1st, 2020. BLFS is attempting to use Python3 as much as possible, but some packages have not been updated to support Python3. &lfs101_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &python2-md5sum; Download size: &python2-size; Estimated disk space required: &python2-buildsize; Estimated build time: &python2-time; Additional Downloads Required patch: Optional HTML Documentation: Python 2 Dependencies Optional and Optional (For Additional Modules) and User Notes: Installation of Python 2 First, disable the installation of a script that overwrites a more recent script: sed -i '/2to3/d' ./setup.py Install Python 2 by running the following commands: patch -Np1 -i ../Python-&python2-version;-security_fixes-1.patch && ./configure --prefix=/usr \ --enable-shared \ --with-system-expat \ --with-system-ffi \ --enable-unicode=ucs4 && make If you invoke the tests, they will run through twice. To test the results, issue: make -k test. Now, as the root user: make altinstall && ln -s python2.7 /usr/bin/python2 && ln -s python2.7-config /usr/bin/python2-config && chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0 Since Python 2 is in maintenance mode, and Python 3 is recommended by upstream for development, you probably do not need to install the documentation. However, if you still want to install documentation for both Python versions, be sure to define the PYTHONDOCS variable for the version you want to use, each time you need to consult the documentation. If you have downloaded the preformatted documentation from , install it as the root user: install -v -dm755 /usr/share/doc/python-&python2-version; && tar --strip-components=1 \ --no-same-owner \ --directory /usr/share/doc/python-&python2-version; \ -xvf ../python-&python2-version;-docs-html.tar.bz2 && find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; && find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \; Command Explanations --with-system-expat: This switch enables linking against system version of Expat. --with-system-ffi: This switch enables linking against system version of libffi. --enable-unicode=ucs4: This switch enables 32bit Unicode support in Python. : This switch enables building pip and setuptools packaging programs. setuptools is needed for building some Python modules. This switch is not recommended because this version of Python is being phased out. : Use this switch if you want to build Python DBM Module against Berkeley DB instead of GDBM. make altinstall: This make target omits some default symbolic links that may interfere with Python 3. chmod ...: Fix permissions for libraries to be consistent with other libraries. Configuring Python 2 In order for python to find the installed documentation, you must add the following environment variable to individual user's or the system's profile: export PYTHONDOCS=/usr/share/doc/python-&python2-version; Contents Installed Programs Installed Library Installed Directories pydoc, python2 (symlink), python2-config (symlink), python&python2-majorver;, python&python2-majorver;-config, smtpd.py, and idle libpython&python2-majorver;.so /usr/{include,lib}/python&python2-majorver; and /usr/share/doc/python-&python2-version; Short Descriptions idle is a wrapper script that opens a Python aware GUI editor. For this script to run, you must have installed Tk before Python so that the Tkinter Python module is built idle pydoc is the Python documentation tool pydoc python2 is an interpreted, interactive, object-oriented programming language python python&python2-majorver; is a version-specific name for the python program python&python2-majorver; smtpd.py is an SMTP proxy implemented in Python smtpd.py