macOS

Install pyFltk for macOS

Easy method using pip3

  1. Goto Finder -> Applications -> Utilities. Then launch Terminal app
  2. Install command line tools by typing the following command into your terminal
xcode-select  --install
  1. Open a browser and goto brew.sh website
  2. Install the Homebrew package manager for macOS by pasting the Install Homebrew line on the homepage into your terminal. I have also copied it below.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Once Homebrew is installed, then install the fltk package with the following command:
brew install fltk
  1. Currently MacOS ships with Python version 2. So you will need to download and install the latest Python 3 64-bit installer from python.org website.

  2. Finally, install pyFltk with the following command:

pip3 install pyfltk
  1. To test installation, open a new terminal, run the python interpreter and issue the command import fltk inside the python interpreter. If you get no errors then it was successful.

Alternate manual install method (without pip3) after step 6 above.

  1. Download pyFltk-1.3.7_WithSwig.tar.gz file from Sourceforge
Get pyFltk 1.3.7
  1. Change to your Downloads directory
cd Downloads

Type ls to view your files

  1. Extract the file with the command:
tar -xzf pyFltk-1.3.7_WithSwig.tar.gz
  1. Then change directory
cd pyFltk-1.3.7
  1. Build the source code with the command:
python3 setup.py build
  1. Install the software with the command
sudo python3 setup.py install

You will have to type your password for it to complete.

  1. To test installation, open a new terminal, run the python interpreter and issue the command import fltk inside the python interpreter. If you get no errors then it was successful.

  2. Follow the instructions under MS Windows to get the documentation and demo programs. You won’t need 7-zip as it’s for Windows. You can unzip the tar.gz files with the same procedure as step 3.