1
1
Quick Start Guide
2
2
-----------------
3
3
4
- 1. Install Microsoft Visual Studio 2015, any edition.
4
+ 1. Install Microsoft Visual Studio 2017 with Python workload and
5
+ Python native development component.
5
6
1a. Optionally install Python 3.6 or later. If not installed,
6
- get_externals.bat (build.bat -e ) will download and use Python via
7
+ get_externals.bat (via build.bat) will download and use Python via
7
8
NuGet.
8
- 2. Run "build.bat -e " to build Python in 32-bit Release configuration.
9
+ 2. Run "build.bat" to build Python in 32-bit Release configuration.
9
10
3. (Optional, but recommended) Run the test suite with "rt.bat -q".
10
11
11
12
@@ -15,29 +16,14 @@ Building Python using Microsoft Visual C++
15
16
This directory is used to build CPython for Microsoft Windows NT version
16
17
6.0 or higher (Windows Vista, Windows Server 2008, or later) on 32 and 64
17
18
bit platforms. Using this directory requires an installation of
18
- Microsoft Visual C++ 2015 (MSVC 14.0) of any edition. The specific
19
- requirements are as follows:
20
-
21
- Visual Studio Express 2015 for Desktop
22
- Visual Studio Professional 2015
23
- Either edition is sufficient for building all configurations except
24
- for Profile Guided Optimization.
25
- The Python build solution pcbuild.sln makes use of Solution Folders,
26
- which this edition does not support. Any time pcbuild.sln is opened
27
- or reloaded by Visual Studio, a warning about Solution Folders will
28
- be displayed, which can be safely dismissed with no impact on your
29
- ability to build Python.
30
- Required for building 64-bit Debug and Release configuration builds
31
- Visual Studio Premium 2015
32
- Required for building Release configuration builds that make use of
33
- Profile Guided Optimization (PGO), on either platform.
34
-
35
- All you need to do to build is open the solution "pcbuild.sln" in Visual
36
- Studio, select the desired combination of configuration and platform,
37
- then build with "Build Solution". You can also build from the command
38
- line using the "build.bat" script in this directory; see below for
39
- details. The solution is configured to build the projects in the correct
40
- order.
19
+ Microsoft Visual Studio 2017 (MSVC 14.1) with the *Python workload* and
20
+ its optional *Python native development* component selected. (For
21
+ command-line builds, Visual Studio 2015 may also be used.)
22
+
23
+ Building from the command line is recommended in order to obtain any
24
+ external dependencies. To build, simply run the "build.bat" script without
25
+ any arguments. After this succeeds, you can open the "pcbuild.sln"
26
+ solution in Visual Studio to continue development.
41
27
42
28
The solution currently supports two platforms. The Win32 platform is
43
29
used to build standard x86-compatible 32-bit binaries, output into the
@@ -71,8 +57,8 @@ Building Python using the build.bat script
71
57
72
58
In this directory you can find build.bat, a script designed to make
73
59
building Python on Windows simpler. This script will use the env.bat
74
- script to detect one of Visual Studio 2015, 2013, 2012, or 2010, any of
75
- which may be used to build Python, though only Visual Studio 2015 is
60
+ script to detect either Visual Studio 2017 or 2015, either of
61
+ which may be used to build Python. Currently Visual Studio 2017 is
76
62
officially supported.
77
63
78
64
By default, build.bat will build Python in Release configuration for
@@ -83,13 +69,14 @@ this behavior, try `build.bat -h` to learn more.
83
69
C Runtime
84
70
---------
85
71
86
- Visual Studio 2015 uses version 14 of the C runtime (MSVCRT14). The
87
- executables no longer use the "Side by Side" assemblies used in previous
88
- versions of the compiler. This simplifies distribution of applications.
72
+ Visual Studio 2017 uses version 14.0 of the C runtime (vcruntime140).
73
+ The executables no longer use the "Side by Side" assemblies used in
74
+ previous versions of the compiler. This simplifies distribution of
75
+ applications.
89
76
90
- The run time libraries are available under the VC/Redist folder of your
77
+ The run time libraries are available under the redist folder of your
91
78
Visual Studio distribution. For more info, see the Readme in the
92
- VC/Redist folder.
79
+ redist folder.
93
80
94
81
95
82
Sub-Projects
@@ -129,6 +116,8 @@ categories:
129
116
_freeze_importlib
130
117
_freeze_importlib.exe, used to regenerate Python\importlib.h after
131
118
changes have been made to Lib\importlib\_bootstrap.py
119
+ pyshellext
120
+ pyshellext.dll, the shell extension deployed with the launcher
132
121
python3dll
133
122
python3.dll, the PEP 384 Stable ABI dll
134
123
xxlimited
@@ -138,6 +127,7 @@ xxlimited
138
127
The following sub-projects are for individual modules of the standard
139
128
library which are implemented in C; each one builds a DLL (renamed to
140
129
.pyd) of the same name as the project:
130
+ _asyncio
141
131
_ctypes
142
132
_ctypes_test
143
133
_decimal
@@ -147,9 +137,12 @@ _msi
147
137
_multiprocessing
148
138
_overlapped
149
139
_socket
150
- _testcapi
151
140
_testbuffer
141
+ _testcapi
142
+ _testconsole
152
143
_testimportmultiple
144
+ _testmultiphase
145
+ _tkinter
153
146
pyexpat
154
147
select
155
148
unicodedata
@@ -171,62 +164,47 @@ _lzma
171
164
http://tukaani.org/xz/
172
165
_ssl
173
166
Python wrapper for version 1.0.2k of the OpenSSL secure sockets
174
- library, which is built by ssl.vcxproj
167
+ library, which is downloaded from our binaries repository at
168
+ https://github.com/python/cpython-bin-deps.
169
+
175
170
Homepage:
176
171
http://www.openssl.org/
177
172
178
- Building OpenSSL requires nasm.exe (the Netwide Assembler), version
179
- 2.10 or newer from
180
- http://www.nasm.us/
181
- to be somewhere on your PATH. More recent versions of OpenSSL may
182
- need a later version of NASM. If OpenSSL's self tests don't pass,
183
- you should first try to update NASM and do a full rebuild of
184
- OpenSSL. If you use the PCbuild\get_externals.bat method
185
- for getting sources, it also downloads a version of NASM which the
186
- libeay/ssleay sub-projects use.
187
-
188
- The libeay/ssleay sub-projects expect your OpenSSL sources to have
189
- already been configured and be ready to build. If you get your sources
190
- from svn.python.org as suggested in the "Getting External Sources"
191
- section below, the OpenSSL source will already be ready to go. If
192
- you want to build a different version, you will need to run
193
-
194
- PCbuild\prepare_ssl.py path\to\openssl-source-dir
195
-
196
- That script will prepare your OpenSSL sources in the same way that
197
- those available on svn.python.org have been prepared. Note that
198
- Perl must be installed and available on your PATH to configure
199
- OpenSSL. ActivePerl is recommended and is available from
200
- http://www.activestate.com/activeperl/
201
-
202
- The libeay and ssleay sub-projects will build the modules of OpenSSL
203
- required by _ssl and _hashlib and may need to be manually updated when
204
- upgrading to a newer version of OpenSSL or when adding new
205
- functionality to _ssl or _hashlib. They will not clean up their output
206
- with the normal Clean target; CleanAll should be used instead.
173
+ Building OpenSSL requires Perl on your path, and can be performed by
174
+ running PCbuild\prepare_ssl.bat. This will retrieve the version of
175
+ the sources matched to the current commit from the OpenSSL branch
176
+ in our source repository at
177
+ https://github.com/python/cpython-source-deps.
178
+
179
+ To use an alternative build of OpenSSL completely, you should replace
180
+ the files in the externals/openssl-bin-<version> folder with your own.
181
+ As long as this folder exists, its contents will not be downloaded
182
+ again when building.
183
+
207
184
_sqlite3
208
185
Wraps SQLite 3.14.2.0, which is itself built by sqlite3.vcxproj
209
186
Homepage:
210
187
http://www.sqlite.org/
211
188
_tkinter
212
- Wraps version 8.6.6 of the Tk windowing system.
189
+ Wraps version 8.6.6 of the Tk windowing system, which is downloaded
190
+ from our binaries repository at
191
+ https://github.com/python/cpython-bin-deps.
192
+
213
193
Homepage:
214
194
http://www.tcl.tk/
215
195
216
- Tkinter's dependencies are built by the tcl.vcxproj and tk.vcxproj
217
- projects. The tix.vcxproj project also builds the Tix extended
218
- widget set for use with Tkinter.
196
+ Building Tcl and Tk can be performed by running
197
+ PCbuild\prepare_tcltk.bat. This will retrieve the version of the
198
+ sources matched to the current commit from the Tcl and Tk branches
199
+ in our source repository at
200
+ https://github.com/python/cpython-source-deps.
219
201
220
- Those three projects install their respective components in a
202
+ The two projects install their respective components in a
221
203
directory alongside the source directories called "tcltk" on
222
204
Win32 and "tcltk64" on x64. They also copy the Tcl and Tk DLLs
223
205
into the current output directory, which should ensure that Tkinter
224
206
is able to load Tcl/Tk without having to change your PATH.
225
207
226
- The tcl, tk, and tix sub-projects do not clean their builds with
227
- the normal Clean target; if you need to rebuild, you should use the
228
- CleanAll target or manually delete their builds.
229
-
230
208
231
209
Getting External Sources
232
210
------------------------
@@ -254,8 +232,8 @@ as the values of certain properties in order for the build solution to
254
232
find them. This is an advanced topic and not necessarily fully
255
233
supported.
256
234
257
- The get_externals.bat script is called automatically by build.bat when
258
- you pass the '-e ' option to it .
235
+ The get_externals.bat script is called automatically by build.bat
236
+ unless you pass the '-E ' option.
259
237
260
238
261
239
Profile Guided Optimization
@@ -298,7 +276,7 @@ carefully modified by hand.
298
276
The property files used are:
299
277
* python (versions, directories and build names)
300
278
* pyproject (base settings for all projects)
301
- * openssl (used by libeay and ssleay projects )
279
+ * openssl (used by projects dependent upon OpenSSL )
302
280
* tcltk (used by _tkinter, tcl, tk and tix projects)
303
281
304
282
The pyproject property file defines all of the build settings for each
0 commit comments