You must install Python 2.7.9 or higher (but lower than Python 3) to run the Guardium
Application Framework SDK on the macOS operating system.
Before you begin
Log in to your mac and run the command: $ xcode-select
--install
About this task
macOS usually comes with Python 2.7.x. Do not use the macOS version of Python. Instead, install
the latest Python 2 version using, for example, the Homebrew package manager. This installs an
alternative Python, in addition to the existing Python.
Make sure Python command points to the latest Python you installed.
Procedure
-
To install Python 2 using the Homebrew package manager,
- Install Homebrew with this
command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install Python 2, enter: brew install python@2
- Make sure the Python command points to the latest Python you installed with Homebrew:
ls -l `which python`
You should see something similar to:
/usr/local/bin/python -> ../Cellar/python@2/2.7.14_3/bin/python
- Check that your installed Python version is running, enter python
--version
The system should respond with the version number, 2.7.9 and higher.
-
Alternatively, you can install Python with pyenv.
- Install pyenv, enter pip install pyenv
- Install Python, enter pyenv install <version>, for example
pyenv install 2.7.9
- Check that the Python version was installed, by entering pyenv
versions
- Use Python locally, enter pyenv global 2.7.9
- Check that your installed Python version is running, enter python
--version