
上QQ阅读APP看书,第一时间看更新
macOS
macOS comes with Python 2.7 installed. To ensure compatibility with the example code in this book, Python 3.4 or above is required, which is available for download from https://www.python.org/downloads/mac-osx/. You will be prompted by a graphical installation wizard when you run the downloaded installation package:

After completing the graphical installation steps, Python 3 can be accessed via these steps:
- Open the Finder app.
- Navigate to the Applications folder, and then go into the Utilities folder.
- Open the Terminal app.
- You will be prompted by the following message when you type python3 in the terminal:
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36 [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on Darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
Some Python packages require requires Xcode Command Line Tools to compile properly. Xcode can be obtained from Mac App Store. To install the command line tools, enter the following command in Terminal: xcode-select --install and follow the installation prompts.