Skip to content

Commit 3891391

Browse files
committed
doc: reconcile README with Python 3 compat changes
PR-URL: #1911 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
1 parent 07f81f1 commit 3891391

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ below) it will attempt to find a compatible Python executable.
3434

3535
### On Unix
3636

37-
* `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)
37+
* Python v2.7, v3.5, v3.6, or v3.7
3838
* `make`
3939
* A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)
4040

4141
### On macOS
4242

43-
* `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on macOS)
43+
* Python v2.7, v3.5, v3.6, or v3.7
4444
* [Xcode](https://developer.apple.com/xcode/download/)
4545
* You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`.
4646

4747
### On Windows
4848

49+
Install the current version of Python from the [Microsoft Store package](https://docs.python.org/3/using/windows.html#the-microsoft-store-package).
50+
4951
#### Option 1
5052

5153
Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).
@@ -56,7 +58,6 @@ Install tools and configuration manually:
5658
* Install Visual C++ Build Environment: [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools)
5759
(using "Visual C++ build tools" workload) or [Visual Studio 2017 Community](https://visualstudio.microsoft.com/pl/thank-you-downloading-visual-studio/?sku=Community)
5860
(using the "Desktop development with C++" workload)
59-
* Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.)
6061
* Launch cmd, `npm config set msvs_version 2017`
6162

6263
If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips.
@@ -69,15 +70,15 @@ If you have multiple Python versions installed, you can identify which Python
6970
version `node-gyp` uses by setting the `--python` variable:
7071

7172
``` bash
72-
$ node-gyp <command> --python /path/to/executable/python2.7
73+
$ node-gyp <command> --python /path/to/executable/python
7374
```
7475

7576
If `node-gyp` is called by way of `npm`, *and* you have multiple versions of
7677
Python installed, then you can set `npm`'s 'python' config key to the appropriate
7778
value:
7879

7980
``` bash
80-
$ npm config set python /path/to/executable/python2.7
81+
$ npm config set python /path/to/executable/python
8182
```
8283

8384
If the `PYTHON` environment variable is set to the path of a Python executable,
@@ -134,7 +135,7 @@ JSON-like format. This file gets placed in the root of your package, alongside
134135

135136
A barebones `gyp` file appropriate for building a Node.js addon could look like:
136137

137-
``` python
138+
```python
138139
{
139140
"targets": [
140141
{
@@ -194,7 +195,7 @@ Some additional resources for addons and writing `gyp` files:
194195
| `--proxy=$url` | Set HTTP proxy for downloading header tarball
195196
| `--cafile=$cafile` | Override default CA chain (to download tarball)
196197
| `--nodedir=$path` | Set the path to the node source code
197-
| `--python=$path` | Set path to the Python 2 binary
198+
| `--python=$path` | Set path to the Python binary
198199
| `--msvs_version=$version` | Set Visual Studio version (Windows only)
199200
| `--solution=$solution` | Set Visual Studio Solution version (Windows only)
200201

0 commit comments

Comments
 (0)