Reputation: 3333
Python security updates are source only updates. There is no windows installer.
For instance the page for python 3.6.12 states:
Security fix releases are produced periodically as needed and are source-only releases; binary installers are not provided.
Could someone explain how I can update/patch a Python installation done by the windows installer, so that latest Python security fixes are applied: eg., going from ython 3.6.6 to Python 3.6.12
Or if not possible how to install from Python source code directly.
Upvotes: 21
Views: 12281
Reputation: 5645
To install security patches after the last full bugfix release, you must build Python from source:
Visual Studio 2019 Community
and select:the Python development workload, and
the Python native development tools (this is under Optional
, but is necessary in order to build python from source)
Download the python source code and unzip it.
Navigate to the folder and install required external dependencies by running PCbuild\get_externals.bat
Build the debug (python_d.exe
) and release (python.exe
) binaries
> PCbuild\build.bat -p x64 -c Debug
> PCbuild\build.bat -p x64 -c Release
you can also build the Profile Guided Optimization (pgo
) binary
> PCbuild\build.bat -p x64 --pgo
The binaries on python.org
are run through PGO by default, so a --pgo
binary will be faster than a -c Release
binary. The debug binary is necessary for adding breakpoints and debugging your code.
All built binaries are placed in PCbuild\amd64
.
The instructions for building an installer are in Tools\msi\README.txt
.
Tools\msi\get_externals.bat
NOTE: This is done in addition to running
PCbuild/get_externals.bat
.It installs additional binaries to
externals\windows-installer
that are needed for making installers. Specifically,
- WiX (
wix.exe
), which is a toolset that lets developers create installers for Windows Installer, the Windows installation engine.- HTML Help (
htmlhelp
), which is for building documentation.
NOTE: This is required by WiX.
> .\Tools\msi\buildrelease.bat -x64
NOTE: Be sure the following environment variables are properly set or left blank so the script can set them:
PYTHON=<path to python.exe>
SPHINXBUILD=<path to sphinx-build.exe>
The installer will be placed in PCbuild\amd64\en-us
. It is a single .exe
(the installer entry point). The folder will also have a number of additional CAB and MSI files. Each MSI contains the logic required to install a component or feature of Python, but these should not be run directly.
Specify --pack
to build an installer that does not require all MSIs to be available alongside. This takes longer, but is easier to share.
Upvotes: 15
Reputation: 71
I managed to install python of version 3.6.13 using conda
Just install python 3.6 in separate invironment:
conda create -n myenvironment python=3.6
conda activate myenvironment
python --vesion
Or point out specific version:
conda create -n myenvironment python=3.6.13
Check all available versions:
conda search python
Upvotes: 1
Reputation: 653
I'm not sure why you just don't install a newer version as you're on windows (3.8), but if you really have to do it from source, this link should help you.
https://docstore.mik.ua/orelly/other/python/0596001886_pythonian-chp-2-sect-1.html
Disclaimer: I've not tested it, but the process should work
Upvotes: -1