Install the TWS API on MacOs / Linux
Install the TWS API on MacOs / Linux
- Download the IB API for Mac/Unix zip file to your local machine from https://interactivebrokers.github.io/
- Once you have clicked “I Agree”, select the download option under the Mac/Unix section to download the API Software.
- This will download
twsapi_macunix.<Major Version>.<Minor Version>.zipto your computer (where <Major Version> and <Minor Version> are the major and minor version numbers respectively).- By default, this will be in your user’s Downloads folder.
- Open MacOS Terminal
- Press the
Command+Spacekeyboard commands to launch Spotlight. - Type
terminaland press Return)
- Press the
- Navigate to your Downloads directory to find the zip file by entering
cd ~/Downloadsthen press Return. - Unzip the API folder with
sudo unzip twsapi_macunix.<Major Version>.<Minor Version>.zip -d $HOME/and press Return. - Verify the API contents are successfully unzipped to your
$HOMEdirectory.cd ~/IBJtsll -la- This will display a list of files in the directory, including
samples,source, andAPI_VersionNum.txt
Notes:
- On MacOS, if you directly open the
twsapi_macunix.<Major Version>.<Minor Version>.zipfile through Finder, you will receive error: “Unable to expand…… It is an unsupported format”. It is required for users to unzip the zipped TWS API file using the above MacOS Terminal command. - PYTHON While Updating the Python Interpreter, running
python3 setup.py installmay display “ModuleNotFoundError: No Module named 'setuptools':. Assetuptoolsis deprecated, this may be fixed by:- Navigate to the installation folder. By default, this is done in the terminal with
cd ~/IBJts/source/pythonclient - Grant write permission on the target folder (e.g. ) using
sudo chmod -R 777in order to avoid “error: could not create 'ibapi.egg-info': Permission denied”. - Run
python3 -m pip install .”
- Navigate to the installation folder. By default, this is done in the terminal with

