Download Python For Windows 8 64 Bit

0 views
Skip to first unread message

Casimiro Lurten

unread,
Aug 3, 2024, 1:20:52 PM8/3/24
to tinftunewsgrup

Unlike most Unix systems and services, Windows does not include a systemsupported installation of Python. To make Python available, the CPython teamhas compiled Windows installers with every release for many years. These installersare primarily intended to add a per-user installation of Python, with thecore interpreter and library being used by a single user. The installer is alsoable to install for all users of a single machine, and a separate ZIP file isavailable for application-local distributions.

As specified in PEP 11, a Python release only supports a Windows platformwhile Microsoft considers the platform under extended support. This means thatPython 3.12 supports Windows 8.1 and newer. If you require Windows 7support, please install Python 3.8.

The Microsoft Store package is a simple installation of Python that is suitable forrunning scripts and packages, and using IDLE or other development environments.It requires Windows 10 and above, but can be safely installed without corrupting otherprograms. It also provides many convenient commands for launching Python andits tools.

The nuget.org packages are lightweight installations intended for continuousintegration systems. It can be used to build Python packages or run scripts,but is not updateable and has no user interface tools.

Four Python 3.12 installers are available for download - two each for the32-bit and 64-bit versions of the interpreter. The web installer is a smallinitial download, and it will automatically download the required components asnecessary. The offline installer includes the components necessary for adefault installation and only requires an internet connection for optionalfeatures. See Installing Without Downloading for other ways to avoid downloadingduring installation.

All of the options available in the installer UI can also be specified from thecommand line, allowing scripted installers to replicate an installation on manymachines without user interaction. These options may also be set withoutsuppressing the UI in order to change some of the defaults.

To allow users to easily install a personal copy of Python without the testsuite, you could provide a shortcut with the following command. This willdisplay a simplified initial page and disallow customization:

The options listed above can also be provided in a file named unattend.xmlalongside the executable. This file specifies a list of options and values.When a value is provided as an attribute, it will be converted to a number ifpossible. Values provided as element text are always left as strings. Thisexample file sets the same options as the previous example:

As some features of Python are not included in the initial installer download,selecting those features may require an internet connection. To avoid thisneed, all possible components may be downloaded on-demand to create a completelayout that will no longer require an internet connection regardless of theselected features. Note that this download may be bigger than required, butwhere a large number of installations are going to be performed it is veryuseful to have a locally cached copy.

Execute the following command from Command Prompt to download all possiblerequired files. Remember to substitute python-3.9.0.exe for the actualname of your installer, and to create layouts in their own directories toavoid collisions between files with the same name.

After installation, Python may be launched by finding it in Start.Alternatively, it will be available from any Command Prompt or PowerShellsession by typing python. Further, pip and IDLE may be used by typingpip or idle. IDLE can also be found in Start.

If you have installed another version of Python and added it to yourPATH variable, it will be available as python.exe rather than theone from the Microsoft Store. To access the new installation, usepython3.exe or python3.x.exe.

To remove Python, open Settings and use Apps and Features, or else findPython in Start and right-click to select Uninstall. Uninstalling willremove all packages you installed directly into this Python installation, butwill not remove any virtual environments

Because of restrictions on Microsoft Store apps, Python scripts may not havefull write access to shared locations such as TEMP and the registry.Instead, it will write to a private copy. If your scripts must modify theshared locations, you will need to install the full installer.

At runtime, Python will use a private copy of well-known Windows folders and the registry.For example, if the environment variable %APPDATA% is c:\Users\\AppData\,then when writing to C:\Users\\AppData\Local will write toC:\Users\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\Local\.

When reading files, Windows will return the file from the private folder, or if that does not exist, thereal Windows directory. For example reading C:\Windows\System32 returns the contents of C:\Windows\System32plus the contents of C:\Program Files\WindowsApps\package_name\VFS\SystemX86.

To select a particular version, add a -Version 3.x.y. The output directorymay be changed from ., and the package will be installed into asubdirectory. By default, the subdirectory is named the same as the package,and without the -ExcludeVersion option this name will include the specificversion installed. Inside the subdirectory is a tools directory thatcontains the Python installation:

In general, nuget packages are not upgradeable, and newer versions should beinstalled side-by-side and referenced using the full path. Alternatively,delete the package directory manually and install it again. Many CI systemswill do this automatically if they do not preserve files between builds.

Alongside the tools directory is a build\native directory. Thiscontains a MSBuild properties file python.props that can be used in aC++ project to reference the Python install. Including the settings willautomatically use the headers and import libraries in your build.

An application written in Python does not necessarily require users to be awareof that fact. The embedded distribution may be used in this case to include aprivate version of Python in an install package. Depending on how transparent itshould be (or conversely, how professional it should appear), there are twooptions.

Using a specialized executable as a launcher requires some coding, but providesthe most transparent experience for users. With a customized launcher, there areno obvious indications that the program is running on Python: icons can becustomized, company and version information can be specified, and fileassociations behave properly. In most cases, a custom launcher should simply beable to call Py_Main with a hard-coded command line.

The simpler approach is to provide a batch file or generated shortcut thatdirectly calls the python.exe or pythonw.exe with the requiredcommand-line arguments. In this case, the application will appear to be Pythonand not its actual name, and users may have trouble distinguishing it from otherrunning Python processes or file associations.

With the latter approach, packages should be installed as directories alongsidethe Python executable to ensure they are available on the path. With thespecialized launcher, packages can be located in other locations as there is anopportunity to specify the search path before launching the application.

Applications written in native code often require some form of scriptinglanguage, and the embedded Python distribution can be used for this purpose. Ingeneral, the majority of the application is in native code, and some part willeither invoke python.exe or directly use python3.dll. For either case,extracting the embedded distribution to a subdirectory of the applicationinstallation is sufficient to provide a loadable Python interpreter.

As with the application use, packages can be installed to any location as thereis an opportunity to specify search paths before initializing the interpreter.Otherwise, there is no fundamental differences between using the embeddeddistribution and a regular installation.

To run Python conveniently from a command prompt, you might consider changingsome default environment variables in Windows. While the installer provides anoption to configure the PATH and PATHEXT variables for you, this is onlyreliable for a single, system-wide installation. If you regularly use multipleversions of Python, consider using the Python Launcher for Windows.

Including the variable name within percent signs will expand to the existingvalue, allowing you to add your new value at either the start or the end.Modifying PATH by adding the directory containingpython.exe to the start is a common way to ensure the correct versionof Python is launched.

The PYTHONPATH variable is used by all versions of Python,so you should not permanently configure it unless the listed pathsonly include code that is compatible with all of your installed Pythonversions.

You can use the Python UTF-8 Mode to change the default textencoding to UTF-8. You can enable the Python UTF-8 Mode viathe -X utf8 command line option, or the PYTHONUTF8=1 environmentvariable. See PYTHONUTF8 for enabling UTF-8 mode, andExcursus: Setting environment variables for how to modify environment variables.

Note that adding PYTHONUTF8=1 to the default environment variableswill affect all Python 3.7+ applications on your system.If you have any Python 3.7+ applications which rely on the legacysystem encoding, it is recommended to set the environment variabletemporarily or use the -X utf8 command line option.

The Python launcher for Windows is a utility which aids in locating andexecuting of different Python versions. It allows scripts (or thecommand-line) to indicate a preference for a specific Python version, andwill locate and execute that version.

Unlike the PATH variable, the launcher will correctly select the mostappropriate version of Python. It will prefer per-user installations oversystem-wide ones, and orders by language version rather than using the mostrecently installed version.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages