Python Environment on macOS

This section provides a tutorial example on how to verify Python 3 environment on macOS computers and install it if missing. Python 3 has more public libraries available for building neural network models.

For those who are using macOS computers to build neural network models in Python language, you can follow this tutorial to verify your Python environment.

1. Try to run some "python" commands given below in a terminal window to see if Python is pre-installed on the system and what is the Python version:

herong$ python --version
Python 2.7.10

herong$ python3 --version
-bash: python3: command not found

If you are getting the above output, you should continue with this tutorial to install Python 3, which has more public libraries available for building neural network models.

2. Go to Python download Website at https://www.python.org/downloads/.

3. Click "Download Python 3.8.0" button. And save the download file, python-3.8.0-macosx10.9.pkg, to your Downloads directory.

4. Double-click on the download file "python-3.8.0-macosx10.9.pkg" And follow the given installation instructions to finish the installation.

5. Verify Python 3 installation by running "python" commands again:

herong$ python --version
Python 2.7.10

herong$ python3 --version
Python 3.8.0

Excellent! You have Python 3 environment ready on your macOS computer now. Remember to use "python3", instead of "python", command to run your code in Python 3 environment.

Table of Contents

 About This Book

 Deep Playground for Classical Neural Networks

Building Neural Networks with Python

Python Environment on macOS

 NumPy - Python Library for Matrix operations

 SciPy - Python Library for Mathematical Functions

 Simple Example of Neural Networks

 TensorFlow - Machine Learning Platform

 PyTorch - Machine Learning Platform

 Gradio - ML Demo Platform

 CNN (Convolutional Neural Network)

 RNN (Recurrent Neural Network)

 GNN (Graph Neural Network)

 GAN (Generative Adversarial Network)

 Performance Evaluation Metrics

 References

 Full Version in PDF/EPUB